Sender address rejected - php

I'm trying to use PHPMAILER, but I keep getting:
SMTP -> FROM SERVER:220 smart6.bol.com.br ESMTP
SMTP -> FROM SERVER: 250-smart6.bol.com.br 250-PIPELINING 250-SIZE 13312000 250-VRFY 250-ETRN 250-AUTH LOGIN PLAIN 250-AUTH=LOGIN PLAIN 250 8BITMIME
SMTP -> FROM SERVER:250 Ok
SMTP -> FROM SERVER:553 : Sender address rejected: not owned by user X
SMTP -> ERROR: RCPT not accepted from server: 553 : Sender address rejected: not owned by user deltrem1984#bol.com.br
SMTP Error: The following recipients failed: deltrem1984#bol.com.br
What should I do?

Often for anti-spam purposes, "$mail->From" is required to be the same address as you use for login to your SMTP server.
If that is your case, you can use the "$mail->AddReplyTo" field for the senders address instead. Only a suggestion.
If it is not the solution, some extra debugging information can be enabled by setting
$mail->SMTPDebug = true;

You should also be careful about email address aliases, because your SMTP server may be rejecting your mails for that reason (it depends on server configuration).

Related

SMTPError: Password command Failed PHPMailer

The Requirement is that when the form is submitted the mail has to be sent the specified email address. For this I am using PHPMailer.
When I ran the code first time from localhost, I received Critical Security Alert received in Gmail, which I resolved by turning on "Allow Less Secure Apps" and also
checked and approved the security event.Now the code works perfectly in localhost powered by xampp but not in shared hosting. When I hit the submit button in the Form page present in shared hosting, I get the following message:
2020-02-25 09:48:40 SERVER -> CLIENT: 220 smtp.gmail.com ESMTP t131sm5033428oih.35 - gsmtp<br>
2020-02-25 09:48:40 CLIENT -> SERVER: EHLO www.domain_name.com<br>
2020-02-25 09:48:40 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [AAA.BB.CCC.DD]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8<br>
2020-02-25 09:48:40 CLIENT -> SERVER: STARTTLS<br>
2020-02-25 09:48:40 SERVER -> CLIENT: 220 2.0.0 Ready to start TLS<br>
2020-02-25 09:48:44 CLIENT -> SERVER: EHLO www.domain_name.com<br>
2020-02-25 09:48:44 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [AAA.BB.CCC.DD]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8<br>
2020-02-25 09:48:44 CLIENT -> SERVER: AUTH LOGIN<br>
2020-02-25 09:48:44 SERVER -> CLIENT: 334 VXNlcm5hbWU6<br>
2020-02-25 09:48:44 CLIENT -> SERVER: [credentials hidden]<br>
2020-02-25 09:48:44 SERVER -> CLIENT: 334 UGFzc3dvcmQ6<br>
2020-02-25 09:48:44 CLIENT -> SERVER: [credentials hidden]<br>
2020-02-25 09:48:45 SERVER -> CLIENT: 534-5.7.14 <https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbv534-5.7.14 ymrjiXdYur3ddtR_6o2GrGNO2DfOQ7VhdphcGz7dq3__0gTNj1-oIXqZ__3KYGCWXt-ZC534-5.7.14 znNW-khosAGrPwCN1mDscVVYa5ms25Ann9jrAUU39WELRqwVrSmhOMGa91Ec4JRu>534-5.7.14 Please log in via your web browser and then try again.534-5.7.14 Learn more at534 5.7.14 https://support.google.com/mail/answer/78754 t131sm5033428oih.35 - gsmtp<br>
2020-02-25 09:48:45 SMTP ERROR: Password command failed: 534-5.7.14 <https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbv534-5.7.14 ymrjiXdYur3ddtR_6o2GrGNO2DfOQ7VhdphcGz7dq3__0gTNj1-oIXqZ__3KYGCWXt-ZC534-5.7.14 znNW-khosAGrPwCN1mDscVVYa5ms25Ann9jrAUU39WELRqwVrSmhOMGa91Ec4JRu>534-5.7.14 Please log in via your web browser and then try again.534-5.7.14 Learn more at534 5.7.14 https://support.google.com/mail/answer/78754 t131sm5033428oih.35 - gsmtp<br>
SMTP Error: Could not authenticate.<br>
2020-02-25 09:48:45 CLIENT -> SERVER: QUIT<br>
2020-02-25 09:48:45 SERVER -> CLIENT: 221 2.0.0 closing connection t131sm5033428oih.35 - gsmtp<br>
SMTP Error: Could not authenticate.<br>
The PHPMailer code for sending mail follows:
try {
//Server settings
$mail->SMTPDebug = SMTP::DEBUG_SERVER; // Enable verbose debug output
$mail->isSMTP(); // Send using SMTP
$mail->Host = 'smtp.gmail.com'; // Set the SMTP server to send through
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->isHTML();
$mail->Username = 'username#gmail.com'; // SMTP username
$mail->Password = 'password'; // SMTP password
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` also accepted
$mail->Port = 587; // TCP port to connect to
//Recipients
$mail->setFrom('username#gmail.com');
$mail->addAddress('username#yahoo.com'); // Add a recipient
// Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'Mail subject';
$mail->Body = 'Mail Body';
$mail->send();
echo 'done';
} catch (Exception $e) {
echo "Mailer";
}
The following actions have been taken:
Username and Password combination is correct and is not expired.
Verified manually by logging via web and also sending mails from the
localhost.
$mail->SMTPAuth=false cannot be set because majority
of shared hosting providers seems to have disabled this for security
reasons (mainly to avoid spamming and sending of unsolicited emails)
Just for others info! To resolve this issue you have to go to:
https://myaccount.google.com/security?pli=1#connectedapps
then click Allow less secure app to YES
what does it mean to be less secure app? could we change our FAQ instructions and/or implementation so that users do not need to do this extra step?
if not possible, we should at least document in FAQ that user also need to change the setting on their google security account
Your solution :
Your server not supporting phpmailer.
Your account taken as a spam read here : Prevent mail to Gmail users from being blocked or sent to spam
Use or fix App password
If you've turned on 2-Step Verification and are trying to sign in to your Google Account through a device, mobile app, or desktop app, you'll need to enter an App Password.
See more and follow steps here : Use or fix App password
If you're using SMTP (i.e. you're calling isSMTP()), you can get a detailed transcript of the SMTP conversation using the SMTPDebug property. The settings are as follows:
Enabling debug output and troubleshooting
If you are having problems connecting or sending emails through your SMTP server, the SMTP class can provide more information about the processing/errors taking place.
Use the debug functionality of the class to see what's going on in your connections. To do that, set the debug level in your script.
Allow error levels For example:
$mail->SMTPDebug = SMTP::DEBUG_SERVER;
$mail->SMTPDebug = 4; //from 1 to 4 to get more details.
I had error almost same and this code was solved my problem because of my self signed certificate.
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
Once again see SMTP Debugging
Debug levels
Debug output format
Looks like you are trying to connect by curl api or something SERVER: EHLO if so! please add your codes to question.
Well, after a long battle I somehow managed to solve this. I activated DisplayUnlockCaptcha from the following URL:
https://accounts.google.com/b/0/DisplayUnlockCaptcha
Probably because Gmail might have viewed the logins received from PHP file lying in hosting server as untrusted requests. This is because the hosting servers may reside in different places or countries and the login authentication request received would appear different other than the one from where the Gmail account is logged in frequently. So as a security measure, it would have use some captcha mechanism in the background (which which cannot be viewed)

Sending SMTP email via PHPMailer started failing suddenly

I have been using PHPMailer to send SMTP email on behalf of my office365 account, and it was working for about a week. Then it suddenly quit working and I don't know what changed.
When I enable high debug logging in PHPMailer I see this:
SMTP -> FROM SERVER:220 CY4PR15CA0011.outlook.office365.com Microsoft
ESMTP MAIL Service ready at Thu, 10 Jan 2019 13:30:20 +0000 SMTP ->
FROM SERVER: 250-CY4PR15CA0011.outlook.office365.com Hello
[198.154.243.158] 250-SIZE 157286400 250-PIPELINING 250-DSN
250-ENHANCEDSTATUSCODES 250-STARTTLS 250-8BITMIME 250-BINARYMIME
250-CHUNKING 250 SMTPUTF8 SMTP -> ERROR: AUTH not accepted from
server: 504 5.7.4 Unrecognized authentication type
[CY4PR15CA0011.namprd15.prod.outlook.com] SMTP -> FROM SERVER:250
2.0.0 Resetting
This piece seems to be the most relevant:
AUTH not accepted from server: 504 5.7.4 Unrecognized authentication
type
Here are my literal SMTP settings as being handed to PHPMailer:
smtpAuth: true
smtpSecure: STARTTLS
smtpHost: smtp.office365.com
smtpPort: 587
smtpUsername: [hidden]
smtpPassword: [hidden]
emailTo: [hidden]
And the actual PHP code:
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = $smtpAuth;
$mail->SMTPSecure = $smtpSecure;
$mail->Host = $smtpHost;
$mail->Port = $smtpPort;
$mail->Username = $smtpUsername;
$mail->Password = $smtpPassword;
$mail->SetFrom($smtpSenderDisplay);
$mail->IsHTML(true);
$mail->Subject = $subject;
$mail->Body = $body;
$mail->AddAddress($emailTo);
As as sanity check, I set up an SMTP account with these same settings in Windows Live Mail - and everything works. No errors. Outgoing email lands in the inbox of a different email account I have.
So Windows Live Mail is doing something a little differently from what my PHP script is doing AND remember my PHP script was working fine up until a few days ago.
Any ideas what I need to change?
Microsoft changed their SMTP encryption requirement from STARTTLS to TLS. That solved it.

How to send email with smtp.office365 using PHPMailer

I'm using code below to send mail but I get Authentication unsuccessful. The same code works with smtp.gmail.com, but not with smtp.office365.com.
<?php
/**
* This example shows settings to use when sending via Google's Gmail servers.
*/
//SMTP needs accurate times, and the PHP time zone MUST be set
//This should be done in your php.ini, but this is how to do it if you don't have access to that
date_default_timezone_set('Etc/UTC');
require '../PHPMailerAutoload.php';
//Create a new PHPMailer instance
$mail = new PHPMailer;
//Tell PHPMailer to use SMTP
$mail->isSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 4;
//Ask for HTML-friendly debug output
$mail->Debugoutput = 'html';
//Set the hostname of the mail server
$mail->Host = 'tls://smtp.office365.com';
// use
// $mail->Host = gethostbyname('smtp.gmail.com');
// if your network does not support SMTP over IPv6
//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
$mail->Port = 587;
//Set the encryption system to use - ssl (deprecated) or tls
$mail->SMTPSecure = 'tls';
//Whether to use SMTP authentication
$mail->SMTPAuth = true;
//Username to use for SMTP authentication - use full email address for gmail
$mail->Username = "anonymized#anonymized.com.br";
//Password to use for SMTP authentication
$mail->Password = "anonymized";
//Set who the message is to be sent from
$mail->setFrom('anonymized#anonymized.com.br', 'First Last');
//Set an alternative reply-to address
$mail->addReplyTo('anonymized#anonymized.com.br', 'First Last');
//Set who the message is to be sent to
$mail->addAddress('anonymized#anonymized.com.br', 'John Doe');
//Set the subject line
$mail->Subject = 'PHPMailer GMail SMTP test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';
//Attach an image file
$mail->addAttachment('images/phpmailer_mini.png');
//send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
I get the following output:
2017-06-06 18:24:34 SERVER -> CLIENT: 220 FR1PR80CA0087.outlook.office365.com Microsoft ESMTP MAIL Service ready at Tue, 6 Jun 2017 18:24:25 +0000
2017-06-06 18:24:34 CLIENT -> SERVER: EHLO desenv
2017-06-06 18:24:34 SERVER -> CLIENT: 250-FR1PR80CA0087.outlook.office365.com Hello [201.47.213.100]250-SIZE 157286400250-PIPELINING250-DSN250-ENHANCEDSTATUSCODES250-STARTTLS250-8BITMIME250-BINARYMIME250 CHUNKING
2017-06-06 18:24:34 CLIENT -> SERVER: STARTTLS
2017-06-06 18:24:34 SERVER -> CLIENT: 220 2.0.0 SMTP server ready
2017-06-06 18:24:35 CLIENT -> SERVER: EHLO desenv
2017-06-06 18:24:35 SERVER -> CLIENT: 250-FR1PR80CA0087.outlook.office365.com Hello [201.47.213.100]250-SIZE 157286400250-PIPELINING250-DSN250-ENHANCEDSTATUSCODES250-AUTH LOGIN250-8BITMIME250-BINARYMIME250 CHUNKING
2017-06-06 18:24:35 CLIENT -> SERVER: AUTH LOGIN
2017-06-06 18:24:35 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2017-06-06 18:24:35 CLIENT -> SERVER: xxx
2017-06-06 18:24:35 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2017-06-06 18:24:35 CLIENT -> SERVER: xxx
2017-06-06 18:24:40 SERVER -> CLIENT: 535 5.7.3 Authentication unsuccessful [FR1PR80CA0087.lamprd80.prod.outlook.com]
2017-06-06 18:24:40 SMTP ERROR: Password command failed: 535 5.7.3 Authentication unsuccessful [FR1PR80CA0087.lamprd80.prod.outlook.com]
SMTP Error: Could not authenticate.
2017-06-06 18:24:40 CLIENT -> SERVER: QUIT
2017-06-06 18:24:40 SERVER -> CLIENT: 221 2.0.0 Service closing transmission channel
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
I tried many things. Changing file encoding because in this question smtplib.SMTPAuthenticationError: (535, '5.7.3 Authentication unsuccessful') the problem was the encoding of the password.
I tried using this, as in PHPMailer Authentication unsuccessful:
$mail->SMTPAuth = False;
But I got:
2017-06-06 18:28:59 SERVER -> CLIENT: 530 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM [RO1P215CA0017.LAMP215.PROD.OUTLOOK.COM]
2017-06-06 18:28:59 SMTP ERROR: MAIL FROM command failed: 530 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM [RO1P215CA0017.LAMP215.PROD.OUTLOOK.COM]
The following From address failed: rrjuridico#grupopetropolis.com.br : MAIL FROM command failed,5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM [RO1P215CA0017.LAMP215.PROD.OUTLOOK.COM],530,SMTP server error: MAIL FROM command failed Detail: 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM [RO1P215CA0017.LAMP215.PROD.OUTLOOK.COM] SMTP code: 530
Mailer Error: The following From address failed: rrjuridico#grupopetropolis.com.br : MAIL FROM command failed,5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM [RO1P215CA0017.LAMP215.PROD.OUTLOOK.COM] ,530,SMTP server error: MAIL FROM command failed Detail: 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM [RO1P215CA0017.LAMP215.PROD.OUTLOOK.COM] SMTP code: 530SMTP server error: MAIL FROM command failed Detail: 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM [RO1P215CA0017.LAMP215.PROD.OUTLOOK.COM] SMTP code: 5302017-06-06 18:28:59 CLIENT -> SERVER: QUIT
2017-06-06 18:28:59 SERVER -> CLIENT:
2017-06-06 18:28:59 SMTP ERROR: QUIT command failed:
I tried removing line below:
$mail->isSMTP();
I got Message sent!, but email wasn't sent.
Any Idea, any help would be very much apreciated.
It just looks like you have the wrong ID and password. They were easily decoded from the SMTP transcript (I have removed them - you might want to change your PW now), but your password only contained ASCII characters, so it's not an encoding problem.
You do need to authenticate in order to send on most systems, so your second example makes sense.
Not calling isSMTP() means that it defaults to using mail(), which relays your message via a local mail server; the local delivery may succeed, but the onward delivery many still fail - this matches what you're seeing. To check that, look in your mail server log (usually /var/log/mail.log or nearby).

Can't send email with php using gmail - Authorising error

I'm new to PHP and trying to build a website with registration form. Users should receive an email with a confirmation link (since I have a free hosting server I am trying to use gmail server). The thing is I'm struggling with the email php code. I am trying to use PHPMailer functions as follows:
<?php
/**
* This example shows settings to use when sending via Google's Gmail servers.
*/
//SMTP needs accurate times, and the PHP time zone MUST be set
//This should be done in your php.ini, but this is how to do it if you don't have access to that
date_default_timezone_set('Etc/UTC');
require 'PHPMailer/PHPMailerAutoload.php';
//Create a new PHPMailer instance
$mail = new PHPMailer;
//Tell PHPMailer to use SMTP
$mail->isSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 2;
//Ask for HTML-friendly debug output
$mail->Debugoutput = 'html';
//Set the hostname of the mail server
$mail->Host = 'smtp.gmail.com';
// use
// $mail->Host = gethostbyname('smtp.gmail.com');
// if your network does not support SMTP over IPv6
//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
$mail->Port = 587;
//Set the encryption system to use - ssl (deprecated) or tls
$mail->SMTPSecure = 'tls';
//Whether to use SMTP authentication
$mail->SMTPAuth = true;
//Username to use for SMTP authentication - use full email address for gmail
$mail->Username = "MYEMAIL#gmail.com";
//Password to use for SMTP authentication
$mail->Password = "MYPASSWORD";
//Set who the message is to be sent from
$mail->setFrom('example#example.com', 'Name S');
//Set an alternative reply-to address
$mail->addReplyTo('example#example.com', 'Name S');
//Set who the message is to be sent to
$mail->addAddress('email#gmail.com', 'John Doe');
//Set the subject line
$mail->Subject = 'PHPMailer GMail SMTP test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->msgHTML("HELLo");
//Replace the plain text body with one created manually
//$mail->AltBody = 'This is a plain-text message body';
//send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
?>
I tried both ports 587 and 465. Also tried both ssl and tls. Every time I try to run the code I get the following error:
SERVER -> CLIENT: 220 smtp.gmail.com ESMTP gw4sm17090153wjc.45 - gsmtp
CLIENT -> SERVER: EHLO spec.dr-manny.co.uk SERVER -> CLIENT:
250-smtp.gmail.com at your service, [185.27.134.36]250-SIZE
35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN
OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250
SMTPUTF8 CLIENT -> SERVER: AUTH LOGIN SERVER -> CLIENT: 334
VXNlcm5hbWU6 CLIENT -> SERVER: bWFubnlzYWVkaUBnbWFpbC5jb20= SERVER ->
CLIENT: 334 UGFzc3dvcmQ6 CLIENT -> SERVER: a2luZ29uZW1vaDk5 SERVER ->
CLIENT: 534-5.7.14
Please log in via your web browser
and534-5.7.14 then try again.534-5.7.14 Learn more at534 5.7.14
https://support.google.com/mail/answer/78754 gw4sm17090153wjc.45 -
gsmtp SMTP ERROR: Password command failed: 534-5.7.14
Please log in via your web browser
and534-5.7.14 then try again.534-5.7.14 Learn more at534 5.7.14
https://support.google.com/mail/answer/78754 gw4sm17090153wjc.45 -
gsmtp SMTP Error: Could not authenticate. CLIENT -> SERVER: QUIT
SERVER -> CLIENT: 221 2.0.0 closing connection gw4sm17090153wjc.45 -
gsmtp SMTP connect() failed.
Error: SMTP connect() failed.
Also, I got an email from Gmail with the subject "Someone has your password". I opened the email and found this "
Hi Manny,
Someone just used your password to try to sign in to your Google Account MYEMAIL#gmail.com, using an application such as an email client or mobile device."
I received this email about 15 mins after I ran the php page.
I turned off "2-step verification" and turned off "allow less secure apps". Nothing seems to help. Anyone please could help me?
I had the same issue last year: the code (VB.Net) was OK, so where the credentials. The problem was that gmail didn't like that some app in a web server far away (my hosting) where trying o use your same username.
I fixed it (in two different occasions) by:
Logging in gmail once from that server (using remote desktop).
Logging in here https://accounts.google.com/DisplayUnlockCaptcha from my pc to "unlock" remote connections.
After that test your code again.

Gmail SMTP issue

I have a problem sending an email using gmail's smtp server
Let me explain my situation. 1 week ago, i could send emails using php using smtp. Yesterday my host shifted their websites including mine to a different server. After that i am not able to send emails.
I tested the email scripts on my local machine and it worked just fine.
I am currently using phpmailer to send emails. When the error occurred, i enabled debugging on the php script. I ran the debugging enable version on the remote web server and my local machine.
Here is the output:
Local machine (works)
SMTP -> FROM SERVER:220 mx.google.com ESMTP dj6sm9229359qab.3
SMTP -> FROM SERVER: 250-mx.google.com at your service, [155.41.29.55] 250-SIZE 35882577 250-8BITMIME 250-AUTH LOGIN PLAIN XOAUTH XOAUTH2 250 ENHANCEDSTATUSCODES
SMTP -> FROM SERVER:250 2.1.0 OK dj6sm9229359qab.3
SMTP -> FROM SERVER:250 2.1.5 OK dj6sm9229359qab.3
SMTP -> FROM SERVER:354 Go ahead dj6sm9229359qab.3
SMTP -> FROM SERVER:250 2.0.0 OK 1350437987 dj6sm9229359qab.3
Message sent!
remote server (doesnt work)
SMTP -> FROM SERVER:220-gds-wh1.get-sourced.net ESMTP Exim 4.80 #2 Tue, 16 Oct 2012 21:00:32 -0500 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
SMTP -> FROM SERVER: 250-gds-wh1.get-sourced.net Hello gds-wh1.get-sourced.net [63.141.244.218] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN 250 HELP
SMTP -> ERROR: Password not accepted from server: 535 Incorrect authentication data
SMTP -> FROM SERVER:250 Reset OK
SMTP Error: Could not authenticate. Mailer Error: SMTP Error: Could not authenticate.
If you look closly. In my local machine it seems to have the google's mx-server address in the debug info, but in the remote machine it has the hosting providers info. I don't know if this is normal or not. I am totaly clueless
Could you help me or give me a clue as to what is wrong?
thanks,
Vidhu
Your hosting provider seems to be capturing outbound SMTP requests and forwarding them to their own SMTP server.
Are you connecting to Google on port 25? Instead, connect on port 587, the SMTP submission port. If you're already using 587, and your hosting provider is capturing THIS traffic, then send them a very nasty email threatening to switch hosting providers if they don't stop interfering with your web application immediately. This sort of BS may be tolerated by residential dial-up and DSL subscribers, but it's wholly inappropriate for web hosting and co-location.
If your provider is on the ball, they'll apologize and point you to the section in their terms and conditions that states that outbound SMTP traffic will now be automatically redirected until a removal request is placed via a support ticket.
Oh, and by the way, your new hosting provider has now captured the authentication credentials with which you authenticate with Google. Time to change passwords and implement TLS, though as far as I'm aware, TLS isn't supported by phpMailer.
Perhaps it's time to look at Swiftmailer or a commercial provider like Postmark ?
from what i see, i think you must check did you already put the correct SMTP of google (usually: smtp.gmail.com)?
and to using google smtp, it's required an authentication like user and password from your google account.

Categories