Solved

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

Posted on 2011-09-14
2
585 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…

733 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