读书人

请问怎么用delphi编写可以发送网页样

发布时间: 2012-03-30 17:32:09 作者: rapoo

请教,如何用delphi编写可以发送网页样的邮件?
就是发送的邮件正文当中包含链接?



[解决办法]
可以,以HTML的格式发送就可以了。
[解决办法]
把发送的字符串组成HTML,然后发送出去。
[解决办法]

Delphi(Pascal) code
begin  IdSMTP1.Disconnect;  IdSMTP1.Host := 'smtp.163.com';  IdSMTP1.Username := 'xxxx';  IdSMTP1.Password := 'xxxxxx';  IdSMTP1.AuthenticationType := atLogin;  FIdMessage.From.Address := 'xxx@163.com';  FIdMessage.Recipients.EMailAddresses  := 'xxx@sina.com';  FIdMessage.Body.Add('<a href="http://www.baidu.com/" target="_blank">百度</a>');  FIdMessage.CharSet := 'GB2312';  FIdMessage.ContentType:='text/html';    IdSMTP1.Connect;  IdSMTP1.Authenticate;  IdSMTP1.Send(FIdMessage);end; 

读书人网 >.NET

热点推荐