php - phpMailer Failing Authentication -
i've set automated email delivers message user.
nslookup
this nslookup details domain:
sballiance.co.uk name server ns2.mainnameserver.com. sballiance.co.uk mail handled 0 sballiance-co-uk.mail.protection.outlook.com. sballiance.co.uk descriptive text "v=spf1 include:spf.protection.outlook.com -all" sballiance.co.uk has address 176.32.230.12 sballiance.co.uk descriptive text "ms=ms71078976" sballiance.co.uk has soa record ns.mainnameserver.com. hostmaster.mainnameserver.com. 2014032747 86400 604800 2419200 10800 sballiance.co.uk name server ns.mainnameserver.com.
phpmailer setup
here important details phpmailer setup:
public $host = 'sballiance-co-uk.mail.protection.outlook.com'; public $port = 465; //i've kept default(?) public $smtpsecure = ''; public $smtpauth = true; //default false public $username = 'no-reply@sballiance.co.uk'; public $password = '%password%'; //this username/password combination has been set email address in cpanel equivalent (and works when checking webmail)
here actual function sending mail:
function sendmail($email,$username,$subject,$content){ include "mail/class.phpmailer.php"; include "mail/class.pop3.php"; include "mail/class.smtp.php"; $mail = new phpmailer(); $body = $content; $mail->setfrom('no-reply@sballiance.co.uk', 'sb alliance'); $mail->addreplyto('no-reply@sballiance.co.uk', 'sb alliance'); $address = $email; $mail->addaddress($address, $username); $mail->subject = $subject; $mail->altbody = 'this email requires compatible html email reader'; $mail->msghtml($body); if(!$mail->send()) { return "mailer error: " . $mail->errorinfo; } else { return "sent"; } }
i have tried changing $host
others seem relevant, such mail.sballiance.co.uk
(which webmail service) , outlook.office365.com
no avail.
client-side reports
the error comes looks this:
be careful! sender has failed our fraud detection checks.
and headers this:
x-store-info:sbevkl2qzr7oxo7wid5zcdv2tiiwgqtnv73vphte3hzillthz1cwmfmve6rygldugeyelvvsr9zinu/js1xjwja/khp9v2l3pyv0uctaylo0nw1mbznhwnverqihdm6d34x4hw3u5wa= authentication-results: hotmail.com; spf=fail (sender ip 79.170.43.23) smtp.mailfrom=no-reply@sballiance.co.uk; dkim=none header.d=sballiance.co.uk; x-hmca=fail header.id=no-reply@sballiance.co.uk x-sid-pra: no-reply@sballiance.co.uk x-auth-result: fail x-sid-result: fail x-message-status: n:n x-message-delivery: vj0xlje7dxm9mdtspta7yt0xo0q9mtthrd0xo1ndtd0w x-message-info: nhfq/7gr1vr7v/qbzeyftopex6rvs/tlaqofkdjfprtvulohbgulvnuxnjeurduxerig1vh3ejyglkdh8pik4njppyslfvcsuwx/zpvufhcef+k8unnco1tvasfjwcynog2ekj3v8ua8pnx3qrjrxa1wxy3pgztq0u1pypcfb8zhpylkdxhr07x/ma1hzdymty3rlsqs6cmi3oo7anz2/tj+d0lmcw+i received: mailscan1.extendcp.co.uk ([79.170.43.23]) snt004-mc1f56.hotmail.com on tls secured channel microsoft smtpsvc(7.5.7601.22678); thu, 29 may 2014 12:42:44 -0700 received: lb1.hi.local ([10.0.1.197] helo=mailscan0.hi.local) mailscan-g65.hi.local esmtp (exim 4.80.1) (envelope-from <no-reply@sballiance.co.uk>) id 1wq6dq-0000qo-rj %myemailaddress%; thu, 29 may 2014 20:42:42 +0100 received: lb1.hi.local ([10.0.1.197] helo=web12.extendcp.co.uk) mailscan0.hi.local esmtps (unknown:dhe-rsa-aes256-gcm-sha384:256) (exim 4.80.1) (envelope-from <no-reply@sballiance.co.uk>) id 1wq6dp-000109-4y %myemailaddress%; thu, 29 may 2014 20:42:42 +0100 received: sballiance.co.uk web12.extendcp.co.uk local (exim 4.80.1) (envelope-from <no-reply@sballiance.co.uk>) id 1wq6do-0005sg-vb %myemailaddress%; thu, 29 may 2014 20:42:41 +0100
what can avoid emails failing authentication?
also, if other information required, let me know can more helpful in question.
you have spf record, server sending not listed in it, it's failing spf check:
spf=fail (sender ip 79.170.43.23)
you fix adding clause spf record:
ip4:79.170.43.23
or equivalent a
clause.
your config wrong - in fact i'm surprised it's working @ as-is:
public $smtpsecure = '';
it should be:
public $smtpsecure = 'ssl';
on top of you've based code on old example, , you're including classes may not necessary. base code on up date example , latest phpmailer.
Comments
Post a Comment