PHPMailer with Office 365 SMTP Server

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
danilo.macri
User
Posts: 109

PHPMailer with Office 365 SMTP Server

Post by danilo.macri »

It's definitely my problem but I'm writing to see if anyone can help me.
in phpmaker I have a clicker that sends the email using phpmailer and it works great.
However, as the sending email I have to use a shared Office 365 mailbox which uses my company email (I am an administrator) and my password as login credentials.
Everything works fine and the loop sends the email from the mailbox email but saves the sending in my personal email.
I use office 365 with shared mailboxes.
the problem is that I find the mail invites in mymailadmin@domain.it with sent from mailbox@domain.it.
why is the mail not listed in the sent mail of mailbox@domain.it?

$mail = new \PHPMailer\PHPMailer\PHPMailer();
    $mail->isSMTP();                                  
    $mail->Host = 'smtp.office365.com';  
    $mail->Port = 587;
    $mail->SMTPAuth = true;                               
    $mail->Username = 'mymailadmin@domain.it';                 
    $mail->Password = 'mypassword';                           
    $mail->SMTPSecure = 'TLS';                            
    $mail->From ='mailbox@domain.it';

mobhar
User
Posts: 11807

Post by mobhar »

You may Google "phpmailer from address" for your references.


Post Reply