/mail/community?hl=en
This content is likely not relevant anymore. Try searching or browse recent questions.
I keep getting MAIL not accepted from server SMTP how to fix it?
0
SMTP -> FROM SERVER:220 smtp.gmail.com ESMTP c10sm38105332wrf.58 - gsmtp
SMTP -> FROM SERVER: 250-smtp.gmail.com at your service, [195.201.172.39] 250-SIZE 35882577 250-8BITMIME 250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-CHUNKING 250 SMTPUTF8
SMTP -> FROM SERVER:530-5.5.1 Authentication Required. Learn more at 530 5.5.1 https://support.google.com/mail/?p=WantAuthError c10sm38105332wrf.58 - gsmtp
SMTP -> ERROR: MAIL not accepted from server: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 https://support.google.com/mail/?p=WantAuthError c10sm38105332wrf.58 - gsmtp
Message could not be sent. Mailer Error: The following From address failed: anishopmarket@gmail.com
SMTP server error: 5.5.1 Authentication Required. Learn more at 530 5.5.1 https://support.google.com/mail/?p=WantAuthError c10sm38105332wrf.58 - gsmtp

Here are my codes:

<?php
require("class.smtp.php");
require("class.phpmailer.php");
 $mail = new PHPMailer(true);
    try {
        //Server settings
        $mail->SMTPDebug = 2;                                     
        $mail->isSMTP();                                         
        $mail->Host       = 'smtp.gmail.com'; 
        $mail->Username   = 'anishopmarket@gmail.com';                     
        $mail->Password   = '****************';                               
        $mail->SMTPSecure = 'ssl';                                  
        $mail->Port       = 465;                                   
    
        //Recipients
        $mail->setFrom('anishopmarket@gmail.com', 'Mailer');
        $mail->addAddress('someone@gmail.com', 'Joe User');    
        //$mail->addReplyTo('info@example.com', 'Information');

        // Content
        $mail->isHTML(true);                    
        $mail->Subject = 'Here is the subject';
        $mail->Body    = 'This is the HTML message body <b>in bold!</b>';
        $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
    
        $mail->send();
        echo 'Message has been sent';
    } catch (Exception $e) {
        echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
    }
   
?>
Details
Pinned
Locked
Latest Update Latest Updates (0)
Relevant Answer Relevant Answers (0)
All Replies (1)
Volunteer in this Google supervised forum. Not a Google employee.
Relevant Answer
 
You can ask questions re your code here  https://stackoverflow.com/ 
 
 
Your question is beyond the scope of this help community.
marked this as an answer
This question is locked and replying has been disabled.
Discard post? You will lose what you have written so far.
Write a reply
10 characters required
Failed to attach file, click here to try again.
Discard post?
You will lose what you have written so far.
Personal information found

We found the following personal information in your message:

This information will be visible to anyone who visits or subscribes to notifications for this post. Are you sure you want to continue?

A problem occurred. Please try again.
Create Reply
Edit Reply
This will remove the reply from the Answers section.
Notifications are off
Your notifications are currently off and you won't receive subscription updates. To turn them on, go to Notifications preferences on your Profile page.
Report abuse
Google takes abuse of its services very seriously. We're committed to dealing with such abuse according to the laws in your country of residence. When you submit a report, we'll investigate it and take the appropriate action. We'll get back to you only if we require additional details or have more information to share.

Go to the Legal Help page to request content changes for legal reasons.

Reported post for abuse
Unable to send report.
Report post
What type of post are you reporting?
Google takes abuse of its services very seriously. We're committed to dealing with such abuse according to the laws in your country of residence. When you submit a report, we'll investigate it and take the appropriate action. We'll get back to you only if we require additional details or have more information to share.

Go to the Legal Help page to request content changes for legal reasons.

Reported post for abuse
Unable to send report.
This reply is no longer available.
/mail/threads
//accounts.google.com/ServiceLogin
You'll receive email notifications for new posts at
Unable to delete question.
Unable to update vote.
Unable to update subscription.
You have been unsubscribed
Deleted
Unable to delete reply.
Removed from Answers
Removed from Updates
Marked as Recommended Answer
Marked as Update
Removed recommendation
Undo
Unable to update reply.
Unable to update vote.
Thank you. Your response was recorded.
Unable to undo vote.
Thank you. This reply will now display in the answers section.
Link copied
Locked
Unlocked
Unable to lock
Unable to unlock
Pinned
Unpinned
Unable to pin
Unable to unpin
Marked
Unmarked
Unable to mark
Reported as off topic
Known Issue
Fixed
Marked Fixed
Unmarked Fixed
Unable to mark fixed
Unable to unmark fixed
/profile/0
false
Search
Clear search
Close search
Google apps
Main menu
Search Help Center
true
17
false