Sounds like a DNS issue on the server the site is hosted on - this is
reasonably common and is a pain.
You can usually test this by seeing if your server can send a message to
say a Gmail address. If mail to [email protected] gets through but
[email protected] doesn't, then this is possibly the issue.
What happens, is the web server thinks it's also the mail server for the
domain. So the mail() function sends the message to itself, and not the
correct mail server for company.co.nz - end result is PHP reports the
mail as being sent, but the recipient never gets it.
If this is the issue - you need to update the DNS settings on your
server to either point the MX record to the correct mail server, or
somehow tell the server to use a remote mail exchanger. How this is done
exactly, depends on how your server is setup.
Another thing you can do with HTML Mimemail is to manually set an
external SMTP server. If you have access to an authenticated SMTP
account, this option works well for getting around this particular DNS
issue, or at least verifying if this is the problem.
You haven't mentioned if your server is a proper server, or just a
WAMP/whatever install on your home computer. If it's the latter, some
ISPs do block all mail on port 25 as a way to prevent spam, so using
'localhost' as your SMTP server could result in mail being blocked.
Also, might pay to check if there is a SPF record in place for
company.co.nz - these are sometimes setup to block mail that isn't sent
from a particular mail server.
Hope some of this helps,
Harvey.
On 14/09/2010 4:29 p.m., Brendan Brink wrote:
Hi there,
I have written a system that sends out emails to various people in
response to various activities within the system. The emails are set
to come from different originator addresses, and are generated through
the PHP htmlMimeMail class. If anyone has experience with this, would
greatly appreciate your assistance.
Basically, the client I am working for has set up a generic email:
[email protected] (example address) with which I am setting some
emails to come from.
The email address is set up correctly at the company and is receiving
emails correctly from my system when being sent TO this address.
however, when I send emails to people within the company FROM this
generic email address, eg. to [email protected] FROM
[email protected] - the emails are not being received.
I think it may be a SPAM filtering issue, not sure...the code I am
using is as below, wondered if there was a setting I need to be
setting to get the email through. I am setting the email_server
SESSION to be company.co.nz, however, the emails are being sent
through my host as the system is hosted on my server - perhaps this is
the issue?
All emails are going out ok, the issue is getting them into the
clients organisation and past their filters...just wondering if
something I can do my side or its something that has to be done
through their IT team?
CODE IS AS FOLLOWS
$_SESSION['email_server'] = 'company.co.nz';
$mail= new htmlMimeMail();
$mail->setReturnPath('[email protected]');
$mail->setFrom('[email protected]');
$mail->setHeader('Reply-To','[email protected]');
$mail->setHeader('X-Mailer','Company');
$mail->setSubject('blah blah');
$mail->setSMTPParams('localhost','25');
$mail->setHtml('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"
<http://www.w3.org/TR/html4/loose.dtd>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1"><style type="text/css">
body {
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:14px;
color:#333333;
}
</style>
<body>'blah blah blah'</body>
</html>
');
$mail->send(array('[email protected]'),'smtp');
ANY HELP WOULD BE MUCH APPRECIATED :)
--
Harvey Kane
Phone:
- Auckland: +64 9 950 4133
- Wanaka: +64 3 746 8133
- Mobile: +64 21 811 951
Email: [email protected]
If you need to contact me urgently, please read my email policy
www.ragepank.com/email/
--
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]