php - 在用 phpmailer 发送邮件时它也发送 github,如何删除它?

标签 php phpmailer

我可以完美地使用 phpmailer 发送电子邮件,但是当我在 gmail 中选中“显示原件”时,它显示我的发件人地址中有一个 github 链接,如下所示:

From:   Tamjid Hasan <tamjid8@gmail.com> Using PHPMailer 6.0.6 (https://github.com/PHPMailer/PHPMailer) 

我想知道如何删除那个 github 链接。请任何人帮助我。

最佳答案

您在那里看到的文本来自邮件的 X-Mailer header 。在 PHPMailer 中,这可以用 $mail->XMailer = "Your awesome mailer" 定义。

如果您检查 PHPMailer 代码的源代码,您会发现以下内容:

/**
 * 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 = '';

这意味着您还可以将 XMailer 设置为 ' ' 以禁用 header 。

关于php - 在用 phpmailer 发送邮件时它也发送 github,如何删除它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54402174/

相关文章:

PHPMailer:设置邮寄的消息标题

php - 验证上传的文件类型

PHP 对象及其函数

php - 从 Web 表单上的 50 多个复选框获取输入

瑞士的 PHPExcel 千位分隔符 例如 1'234' 456

phpmailer - PHP mail() 文档说我应该只在正文中使用 LF,但 RFC 5322 另有说明。

php - 在存储到数据库之前清理输入

php - 每次我的邮件在 phpmailer 中变成垃圾邮件

php - Wordpress 插件开发 : Override Default SMTP

PHPMailer 电子邮件发送成功但未收到 (EC2)