Solved

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

Posted on 2011-09-14
2
571 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

757 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

23 Experts available now in Live!

Get 1:1 Help Now