Sending mail with PHPMailer through proxy?

半腔热情 提交于 2019-12-10 16:28:42

问题


I am trying to send an e-mail with PHPMailer through a SMTP proxy but am not able to find a field or function in PHPMailer to allow me to do this.

Maybe you can help me out? If PHPMailer doesn't have support for this maybe you can recommend me a free mailer program which does?

Thank you


回答1:


There's no such thing as an SMTP proxy - only port forwarders (sometimes refered to as Null mailers) and SMTP relays. It is possible to route arbitrary ports/protocols through HTTP and SOCKS proxies - but AFAIK that's not supported by any products out of the box.

For both port forwarders and SMTP relays, it's just a matter of telling phpmailer the host and port to use:

 ...
 $mua = new PHPMailer();
 ...
 $mua->Host = 'my-smtp-relay.example.com';
 $mua->Port = '2525';
 ...
 $mua->Send();
 ...


来源:https://stackoverflow.com/questions/6291190/sending-mail-with-phpmailer-through-proxy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!