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 7966455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:25:51+00:00 2026-06-04T06:25:51+00:00

This is my php code require(class.phpmailer.php); $mail = new PHPMailer(); $mail->IsSMTP(); // telling the

  • 0

This is my php code

require("class.phpmailer.php");

$mail = new PHPMailer();

$mail->IsSMTP();  // telling the class to use SMTP
$mail->Host     = "smtp.gmail.com"; // SMTP server

$mail->From     = "example@gmail.com";
$mail->AddAddress("example@yahoo.com");

$mail->Subject  = "First PHPMailer Message";
$mail->Body     = "Hi! \n\n This is my first e-mail sent through PHPMailer.";
$mail->WordWrap = 50;

if(!$mail->Send()) {
echo 'Message was not sent.';
echo 'Mailer error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent.';
}

My php.ini has this mail configuration
[mail function]

SMTP = smtp.gmail.com
smtp_port = 465
sendmail_from =example@gmail.com

My error is

The following From address failed: example@gmail.com Message was not
sent.Mailer
error: The following From address failed: example@gmail.com
SMTP server error: 5.7.0 Must issue a STARTTLS command first. i1sm13250552pbv.49

please help me.thanks in advance……

  • 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-04T06:25:52+00:00Added an answer on June 4, 2026 at 6:25 am

    smtp.gmail.com requires that you use SSL and port 587 or 465.

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

Sidebar

Related Questions

Possible Duplicate: PHPMailer AddAddress() Here is my code. require('class.phpmailer.php'); $mail = new PHPMailer(); $email
I wrote this code require('Database.class.php'); function get_info (){ $db = new Database($config['server'], $config['user'], $config['pass'],
I have this code: require(class.XMLHttpRequest.php); function hot($news){ $url=https://localhost/search.aspx?search=.$news.; $ajax=new XMLHttpRequest(); $ajax->setRequestHeader(Cookie,Cookie: host); $ajax->open(GET,$url,true); $ajax->send(null);
I'm learning by reading this tutorial: Link Here's the code: <?php require_once 'Zend/Loader.php'; class
I'm wondering what the PHP equivalent to this code is: require zlib foo =
I'm having this problem with this piece of PHP code: class Core { public
This is my code: <?php require_once '../../../jq-config.php'; // include the jqGrid Class require_once ABSPATH.php/jqGrid.php;
I found this PHP code in an app I have to modify... $links =
I am using this PHP code: if (isset($_GET['c'])) { $pages = array(home, upload, signup);
I have this php code $jsonArray = array(); $sql = SELECT ID,CLIENT FROM PLD_SERVERS;

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.