1

When I send email on locally I don't have any problem with sending email.

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.

3
  • What code are you currently using? Commented Feb 28, 2010 at 22:14
  • it's possible that your host does has disabled php mail, maybe because it does not use SMTP authentication to send mails. you might try another method of sending e-mail, such as the phpmailer class (see e.g. askapache.com/php/…) Commented Feb 28, 2010 at 22:24
  • Please post the code here, its kinda hard to help without any context. Commented Mar 1, 2010 at 0:12

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.