Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8325489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:27:16+00:00 2026-06-09T00:27:16+00:00

I am using PHPMailer to send automated e-mails from my website and while testing,

  • 0

I am using PHPMailer to send automated e-mails from my website and while testing, I noticed that all e-mails sent by php mailer are generating the following warning on the recipients end:

This message may not have been sent by: foo@gmail.com Learn more Report phishing

I was wondering if there is a way to avoid this?

PHP Mailer code:

//mail functions
require("mailer/class.phpmailer.php");
require("mailer/class.smtp.php");
require("mailer/class.pop3.php");

$mail = new PHPMailer();
$mail->IsSMTP();  
$mail->Host = "relay-hosting.secureserver.net";
$mail->Port = 25;  
$mail->IsHTML(true);
$mail->Username = "foo@gmail.com";  // SMTP username
$mail->Password = "pass"; // SMTP password

$mail->From = "foo@gmail.com";
$mail->FromName = "FOO";
$mail->AddAddress("fOO@gmail.com", "WIDB");
$mail->AddReplyTo("foo@gmail.com");
//$mail->AddAddress("foo@gmail.com");                  // name is optional

$mail->WordWrap = 50;                                 // set word wrap to 50 characters
//$mail->AddAttachment("/var/tmp/file.tar.gz");         // add attachments
//$mail->AddAttachment("/tmp/image.jpg", "new.jpg");    // optional name
$mail->IsHTML(true);                                  // set email format to HTML

$mail->Subject = 'Foo - Transaction Receipt';
$mail->Body    = $message;
$mail->AltBody = "nothing";

//send mail
$mail->Send();

I am using GMail and I have SMTP enabled…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T00:27:18+00:00Added an answer on June 9, 2026 at 12:27 am

    You can either set up google apps for your site and get a Username@yourwebsite.com gmail account (more info here it’s free), or You will need to set up an e-mail address on your current server that is Username@yourwebsite.com and use that as the $mail->from address.

    Your E-Mail recipients are receiving the message because you are telling google to send an e-mail from your server, and then you are telling them that the mail is coming from gmail, which it isn’t, it’s coming from your personal server. Since the from address and your server address don’t match, they flag it as spam. This is googles way of preventing spam, to them it would be the same if you put $mail->from(YOURMOM@LOL.com). The e-mail would still send, but your domain name does not match the @ address.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using PHPMailer to send email from PHP. My email body contains HTML format
I am using php mailer class to send multiple attachment mails. Two error are
Im using PHP's mail() function to send some emails. But all my mails land
I am trying to send an email from PHP using PHPmailer() . I have
I wrote some code to send an email from my PHP script using PHPMailer.
i have one form and i am using PHPMailer to send data from that
I'm trying to send mail using phpMailer. It's my code: <?php require_once('phpmailer/class.phpmailer.php'); $mail =
I have send an email using php mailer class. mail was sending successfully but
Using google, yahoo and AOL smtp and PHPMailer how many mails can be sent
Is it possible to send mail asycronously using PHP while giving live user feedback

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.