Archive

Posts Tagged ‘phpmailer’

让phpmailer支持中文名称的附件

May 23rd, 2006

phpmailer设置使用utf-8编码发送邮件以后,已经能够正常的发送中文邮件了,当然你调用时传进去的中文参数必须也是utf-8编码才行,但是我发现,即使这样,发送中文文件名的附件的时候,附件名称不能正确的显示。

比如我们要发送的附件是“测试.txt”,如果在添加附件的时候强制使用指定文件名的方式:

$mail->AddAttachment($attach, $attach);

那么发送过去的附件文件名将会是乱码,如果不指定:

$mail->AddAttachment($attach, $attach);

那么发送过去的文件名中的中文干脆没了,成了“.txt”。

究其原因,打

......[Continue Read/阅读全文]

PHP , , , , ,

终于能够通过phpmailer使用gmail账号发送邮件了

April 14th, 2006

phpmailer(现在的版本是1.73)是一个很好用的工具,可以很方便的使用php语言发送邮件,支持smtp及验证,我们一直都用它。

但是,由于gmail的smtp采用了ssl连接:

Outgoing Mail (SMTP) Server – requires TLS: smtp.gmail.com (use authentication) Use Authentication: Yes Use STARTTLS: Yes (some clients call this SSL) Port: 465 or 587

使用phpmailer就无法正常连接gmail的发信

......[Continue Read/阅读全文]

PHP , , , , ,