开发者

Problem with sending email

开发者 https://www.devze.com 2022-12-21 18:01 出处:网络
When I send email on locally I don\'t have any problem with sending ema开发者_如何转开发il. However when I uploaded to my live site, I am not able to send email.

When I send email on locally I don't have any problem with sending ema开发者_如何转开发il.

However when I uploaded to my live site, I am not able to send email.

I use PHP mail function.

Can anyone tell me what I need to look for?

Thanks in advance.


It's very likely that you have your mail configuration set up incorrectly. As stated above, the server may be expecting authentication, or it may be that the SMTP host is not specified.

There's a very very good free PHP component called PHP Mailer (available from http://phpmailer.worxware.com/ ) that is simple to set up, has very powerful mail features - HTML mail, inline attachments etc, is well documented, and above all, uses multiple methods to deliver mail, including accessing SENDMAIL directly, or using it's own SMTP server code.

PHPMailer stands head and shoulders above native PHP mail functionality, so it's well worth a look.


If you have a dedicated server which is not shared with any other apps you didn't personally develop and have control over, then do the following:

  • Ensure that your PHP app is sending to a local MTA, which is accepting the messages
  • Diagnose why your MTA is not delivering the messages.
  • Take steps to get your server's IPs delisted from all the countless blacklists you're currently on.

If on the other hand, your hosting is not completely dedicated to only applications you developed and have full control of (i.e. not spammers), then you can pretty much forget it.

Almost every single shared server provider has it full of dodgy scripts which are either deliberately sending spam, or being compromised by spammers to be used to send spam. The rest just send non-spam mails at a volume which makes them look like spam. As a result they all become constantly blacklisted. Being removed from these blacklists is pointless, as your server will immediately be re-listed once all the spammers you share with resume their spammy spamming.

Conclusion:

  • If you want to send any mail, at all, and hope to have it delivered, use a completely dedicated server.

If you have several apps, you might want to consider using a dedicated outbound IP just for delivering the messages from that app. This reduces the impact of one of them getting blacklisted. IPv4 addresses** aren't really that unavailable that this is unreasonable.

If you don't have your own IP address space, you will need to request it from your colo provider. If possible, ask them what addresses they have available and check them for blacklists BEFORE having them allocated to you.

** Most email providers don't accept mail on IPv6

0

精彩评论

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

关注公众号