PHPMailer Email Sending Issue in cPanel

Issue:

Suddenly, one of my cPanel based VPS customers raised an issue. They usually send emails by using PHPMailer in cPanel. An email address was configured to send emails. Recipient should be able to receive emails from that email address. Their server hostname is like vps.domain.com. Sender email address is set like alice@domain.com. While they are sending emails from the system, the recipient are being received the email form alice@vps.domain.com. It creates a problem of sender identity. Moreover, some email system blocked their email due to nonexistence of the domain vps.domain.com. 

Solution:

We analyzed the issue and came up with a solution forcing the PHPMailer to send emails using designated from address. We added a line in PHPMailer configuration as below.

mail($mail_to, $subject, $mail_html, $headers, '-f alice@domain.com')

After that we again sent the email and received the email using alice@domain.com.

Comments

Popular posts from this blog

Install a Comodo/Sectigo Domain Validation SSL certificate in Zimbra

Adding DKIM record (1024 bit) in Zimbra

Recipient Limit of a Message in Zimbra