Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

300
Views
send email with alias using phpmailer. make sender from alias

I am trying to setfrom to be alias email. I created alias email in gmail. and i set it as default sender so if i send normal email from gmail it is working fine. but when i send email from phpmailer the receiving emails showing the original email and alias email. and my code working with port 465 and ssl. if iam butting it to port 587 and tls doing no thing(phpmailer) not working.

enter image description here

$mail = new PHPMailer(true);
        $mail->isSMTP();
        $mail->SMTPAuth   = true;
        $mail->SMTPSecure = 'ssl';
        $mail->Host = 'smtp.gmail.com';
        $mail->SMTPDebug = 2;
        $mail->Port = 465;
        $mail->IsHTML();
        $mail->Username = 'original email';
        $mail->Password = 'app password';
        $mail->SetFrom('alias email', '');
        $mail->Subject = 'Massage from alias.';
        $mail->Body    = 'test';

        $mail->addAddress('send to', 'ToEmail');
        $mail->send();

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!