Solved

How to send a HTML-file including images with idSMTP (INDY)?

Posted on 2011-09-14
2
575 Views
Last Modified: 2012-05-12
Hi,

Is there a WPTools way to generate HTML-files (including images), I need to be able to load the HTML-files into the body of the Email.
Also I need to personalise the HTML-body for each customer before sending it.

i.e.
Dear %mynamefield%    -> replace ->  Dear George

Thank you for your help.
0
Comment
Question by:Delphiwizard
2 Comments
 
LVL 25

Accepted Solution

by:
epasquier earned 500 total points
ID: 36539979
ahh Google... what a wonderful tool :o)

http://codenewsfast.com/isapi/isapi.dll/article?id=4507106B&article=6979409
http://www.indyproject.org/Sockets/Blogs/RLebeau/2005_08_17_A.en.aspx

after this line :
Body.LoadFromFile(Folder + 'htmlmail.htm');

add this for name replacement
aStr:=Body.Text;
aStr:=StringReplace(aStr, %customer_firstname%, Customer_FirstName, [rfReplaceAll,rfIgnoreCase]);
aStr:=StringReplace(aStr, %customer_lastname%, Customer_LastName, [rfReplaceAll,rfIgnoreCase]);
Body.Text:=aStr;

with Customer_FirstName,Customer_LastName:String as parameters

Open in new window

0
 

Author Closing Comment

by:Delphiwizard
ID: 36540818
Perfect, thank you very much.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now