phpmailer 基本问题

发布于 2024-11-28 00:42:53 字数 1222 浏览 1 评论 0 原文

我正在使用 phpmailer 向我的订阅者发送新闻通讯。

我将标题设置如下:

$headers = "From: Sales - Blah Blah <[email protected]>";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=utf-8\r\n";

现在,在发送的电子邮件中,例如在 Gmail 帐户中,如果您按“显示详细信息”链接,则会出现以下内容。

from    Sales - Blah Blah MIME-Version: 1.0 

[email protected] via ecbiz103.inmotionhosting.com 

to  [email protected]

date    Wed, Aug 3, 2011 at 11:02 AM

subject sales !

***mailed-by    ecbiz103.inmotionhosting.com*** 

问题是:

我怎样才能让它从实际的电子邮件帐户(即“[电子邮件受保护]" 并且能够在我的“已发送”选项卡上查看外发电子邮件吗?

我想,当这种情况发生时,粗体提到的最后一行会说

"mailed by blahblah.com"

问候,乔治

I am using phpmailer to send my newsletter to my subscribers.

I set my headers as following:

$headers = "From: Sales - Blah Blah <[email protected]>";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=utf-8\r\n";

NOW, in the delivered email, for example in a gmail account, if you press the "show details" link, the following appears.

from    Sales - Blah Blah MIME-Version: 1.0 

[email protected] via ecbiz103.inmotionhosting.com 

to  [email protected]

date    Wed, Aug 3, 2011 at 11:02 AM

subject sales !

***mailed-by    ecbiz103.inmotionhosting.com*** 

HERE IS THE QUESTION:

HOW CAN I MAKE IT ACTUALLY SEND THE EMAIL FROM THE ACTUAL EMAIL ACCOUNT, that is "[email protected]" and be able to see the outgoing emails on my "sent" tab?

I guess, when this happens, the last line mentioned in bold would say

"mailed by blahblah.com"

Regards, George

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

南烟 2024-12-05 00:42:53

PHPmailer 与 http://phpmailer.worxware.com 一样吗?或者您是指 PHP 的内置 mail() 函数?看来您正在使用 mail(),因为您正在构建自己的 MIME 消息。不要那样做。它太主要而且不可靠。使用 PHPmailer(在前面提到的链接)或 Swiftmailer 为您做类似的事情。

无论哪种方式,如果您希望发送的邮件显示在帐户的“已发送”文件夹中,则必须使用 blahblah.com 的邮件服务器通过您自己的电子邮件帐户发送电子邮件。另一种选择是设置密件抄送:在每封邮件上默默地复制您自己,并在您的帐户上设置邮件规则以将这些邮件转移到文件夹中。

PHPmailer as in http://phpmailer.worxware.com? Or do you mean PHP's built-in mail() function? It would appear you're using mail(), since you're building your own MIME message. Don't do that. It's too much main and unreliable. use PHPmailer (at the link mentioned earlier) or Swiftmailer to do that sort of thing for you.

Either way, if you want the mails you send to show up in your account's "sent" folder, you'd have to send the emails via your own email account using blahblah.com's mail server. Another option would be to set a BCC: to silently copy yourself on each mail, and have a mail rule on your account to divert those mails to a folder.

我不咬妳我踢妳 2024-12-05 00:42:53

简单的答案是:你不能。

phpmailer 所做的就是连接到邮件服务器来发送邮件。它根本不以任何方式链接到您的实际电子邮件帐户。


编辑:

此外,您将无法删除 ecbiz103.inmotionhosting.com 引用,因为它是发送邮件的服务器的主机名。邮件服务器在一个 IP 地址上运行,该 IP 有一个主机名,在本例中为 ecbiz103.inmotionhosting.com

The simple answer is: you cant.

All phpmailer does is connect to the mail server to send the mail. It does not link to your actual e-mail account in any way at all.


EDIT:

Also, you will not be able to remove the ecbiz103.inmotionhosting.com reference as that is the hostname of the server that is sending the mail. A mail server runs on one IP address, this IP has a hostname, in this case ecbiz103.inmotionhosting.com.

淡水深流 2024-12-05 00:42:53

第一行标头之后没有换行符,特别是 From 标头。

You don't have a newline after the first line of headers, specifically the From header.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文