Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

While sending mail with phpmailer it also send github with it, how to remove it?

Tags:

php

phpmailer

I can send email with phpmailer perfectly but while i check "Show Original" in gmail it show me that there is a github link in my From address, like bellow:

From:   Tamjid Hasan <[email protected]> Using PHPMailer 6.0.6 (https://github.com/PHPMailer/PHPMailer) 

I want to know how to remove that github link. Anyone help me please.

like image 992
Tamjid Hasan Avatar asked Oct 20 '25 00:10

Tamjid Hasan


1 Answers

The text you're seeing there comes from the X-Mailer header of the mail. In PHPMailer this can be defined with $mail->XMailer = "Your awesome mailer".

If you check the source of the PHPMailer code you will find the following:

/**
 * What to put in the X-Mailer header.
 * Options: An empty string for PHPMailer default, whitespace for none, or a string to use.
 *
 * @var string
 */
public $XMailer = '';

This means you could also set XMailer to ' ' to disable the header.

like image 76
JensV Avatar answered Oct 21 '25 15:10

JensV