| 发表于:2008-01-17 00:49:26 楼主 |
我在做邮件客户端。用indy控件做的。使用webbrowser作为编辑器编辑邮件正文,然后发送。但去网页上收看时,却发现所发的邮件内容要么是乱码,要么就是把html代码显示出来了。 如: 我在webbrowser中输入一句话作为正文: this is a test mail. 发送时的代码为: with msg do begin body.clear; body.add((webbrowser1.document as ihtmldocument2).body.outerhtml) ; from.text := mailaccount.emailaddress; replyto.emailaddresses := mailaccount.emailaddress; recipients.emailaddresses := edtrecipients.text; { to: header } subject := edtsubject.text; { subject: header } priority := tidmessagepriority(cbbpriority.itemindex); { message priority } cclist.emailaddresses := edtcc.text; {cc} receiptrecipient.text := ''; end; ..... with smtp do begin connect; send(idmsgsend); disconnect; end; ..... 但是发送成功后,去网页收到的却是不正常的。收到的结果为: <body> this is a test mail. </body> 怎么看上去像是浏览器直接把邮件下文的html代码显出来了? 有哪位高手赐教一下,,不胜感激。 |
|
|
|
|