Sending a csv file through email using smtp

9
Sending a CSV file through Email using SMTP Thanh Nguyen

Transcript of Sending a csv file through email using smtp

Page 1: Sending a csv file through email using smtp

Sending a CSV file through Email using

SMTP

Thanh Nguyen

Page 2: Sending a csv file through email using smtp

Introduction SMTP Transport

• The SMTP transport can be used for sending messages over SMTP using the javax.mail API

• The SMTPS connector enables SMTP over SSL using the javax.mail APIs

• Supports all the elements and attributes of the SMTP transport, plus some required properties for setting up the client key store and the trust store for the SSL connection

Page 3: Sending a csv file through email using smtp

Namespace

• xmlns:smtp="http://www.mulesoft.org/schema/mule/smtp"

• xmlns:smtps="http://www.mulesoft.org/schema/mule/smtps"

Page 4: Sending a csv file through email using smtp

XML Schema location

• http://www.mulesoft.org/schema/mule/smtp http://www.mulesoft.org/schema/mule/smtp/current/mule-smtp.xsd

• http://www.mulesoft.org/schema/mule/smtps http://www.mulesoft.org/schema/mule/smtps/current/mule-smtps.xsd

Page 5: Sending a csv file through email using smtp

Connector syntax

<smtp:connector name="smtpConnector" bccAddresses="[email protected]" ccAddresses="[email protected]" contentType="foo/bar"fromAddress="[email protected]" replyToAddresses="[email protected]"subject="subject"> <smtp:header key="foo" value="bar" /> <smtp:header key="baz" value="boz" /></smtp:connector>

Page 6: Sending a csv file through email using smtp

Connector syntax<smtps:connector name="smtpsConnector" bccAddresses="[email protected]" ccAddresses="[email protected]" contentType="foo/bar"fromAddress="[email protected]" replyToAddresses="[email protected]"subject="subject"> <smtps:header key="foo" value="bar" /> <smtps:header key="baz" value="boz" /> <smtps:tls-client path="clientKeystore" storePassword="mulepassword" /> <smtps:tls-trust-store path="greenmail-truststore" storePassword="password" /></smtps:connector>

Page 7: Sending a csv file through email using smtp

Use the following mimeType in your DataWeave

<dw:input-payload doc:sample="list_csv.csv" mimeType="application/csv"/>

Page 8: Sending a csv file through email using smtp

Sending a CSV file through Email using SMTP

Page 9: Sending a csv file through email using smtp

Question and answer