开发者

How to send an email using PageProducer in Delphi 7?

I am making an application in Delphi 7 and I need to send an email using PageProducer component in order to make it in HTML format. At this point, the objective is to send the email in both formats: text/p开发者_如何学运维lain and text/html, but really know how to send it in only one format: either text/plain or text/html. So, how to send an email using PageProducer in both formats: plain and HTML??

I need that because there are webmail servers that don't accept HTML emails.


PageProducer is just a component for producing HTML content by replacing some tags with your specified content. It has no feature for sending emails.

To send email in Delphi 7, you can use IdSMTP component from Indy Clients tab in Components Palette. As it is clear from its name, this component uses SMTP protocol for sending emails.

In your case, you should first generate HTML content using either PageProducer or any other method, and then pass the HTML content to IdSMTP to be sent as an email.

To send an email in both plain text and HTML format you should use multi-part message. You can refer to Indy help for TIdMessage class.

Regards


You should take a look at the MIME format. This is the format the email is finally sent.

If you understand it you will be able to send Multipart messgaes containing text/plain text/html or attachments. http://en.wikipedia.org/wiki/MIME

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜