Php – Mercury not sending emails

emailPHPxampp

I have a Mercury SMTP server running on localhost (announcing as 127.0.0.1) right now.

Unfortunately, I am unable to send emails from it to GMail.

I tested sending an email to myself using localhost and PHP, and viewed the result in Outlook.

I received both an email and an error message that the email could not be sent.

In Mercury, the only settings I have changed are add the working user to the user-list and set up the SMTP server to announce as 127.0.0.1 (My from is set to @127.0.0.1). Port is 25.

I'm using SwiftMailer to connect (and I know the code works because I could connect to my GMail account).

When I paste the errors with

if (!$mailer->send($message, $failures))
        {
          echo "Failures:";
          print_r($failures);
        }

I get something like Failures:Array( [0]=>'@gmail.com')

What could be the issue? Thanks!

Best Answer

Got the answer, I had to change SMTP settings to allow outgoing mails.

Here is where I got the answer for anyone else having the same problem