This sample demonstrates how to send attractive emails using email templates.
File EmailTemplate.eml used in this sample is located in the folder:
C:\Program Files\CodeSegment\SMS Studio\Samples\EmailConnection
In this example, the email template is used to compose an email message where parameters in the template (%P1%, %P2%...) are replaced with actual values before sending. As a result, the recipient receives the email message that looks like this:
Dear Customer,
We wish to inform you that your account balance has been updated.
Customer ID: C123
Account ID: A456
Account balance: 100
Should you have any questions or need further assistance, feel free to contact us.
Best regards,
Company Name
You can use Outlook Express to create email templates. Select the File / New / Mail Message option and when you finish creating your message, select the File / Save As option in the New Message window. To edit a saved template, double-click on the file and it will be opened in the Message window, remember to use the File / Save As option to save it again to the same file.
Setup Email connection
Send email message
Source code
The contents of the EmailTemplate.eml file:
Subject: Email Template Sample MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0043_01C9E803.DDF4BE80" X-Unsent: 1 This is a multi-part message in MIME format. ------=_NextPart_000_0043_01C9E803.DDF4BE80 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Dear Customer, We wish to inform you that your account balance has been updated. Customer ID: %P1% Account ID: %P2% Account balance: %P3% Should you have any questions or need further assistance, feel free to contact us. Best regards, Company Name ------=_NextPart_000_0043_01C9E803.DDF4BE80 Content-Type: text/html;charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <HTML><HEAD> <STYLE></STYLE> </HEAD> <BODY><FONT face=3DArial size=3D2> Dear Customer,<BR> <BR> We wish to inform you that your account balance has been updated.<BR> <BR> <STRONG>Customer ID:</STRONG> %P1%<BR> <STRONG>Account ID:</STRONG> %P2%<BR> <STRONG>Account balance:</STRONG> %P3%<BR> <BR> Should you have any questions or need further assistance, feel free to contact us.<BR> <BR> Best regards,<BR> Company Name<BR> </FONT></BODY></HTML> ------=_NextPart_000_0043_01C9E803.DDF4BE80--
| Copyright © 2002-2010 CodeSegment. All rights reserved. |