Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Email 使用指定的';从'-地址_Email_Outlook_Eml - Fatal编程技术网

Email 使用指定的';从'-地址

Email 使用指定的';从'-地址,email,outlook,eml,Email,Outlook,Eml,对于一个应用程序,我们希望为用户提供生成的EML,他们可以在Outlook 2010中打开并在对邮件内容进行最小更改或添加附件或收件人后发送。在生成EML时,我们设置的一项内容是“发件人”地址,我们将其设置为邮箱。所有用户都可以访问此邮箱,但当他们打开EML并尝试发送它时,总会返回一个错误: Delivery has failed to these recipients or groups: recipient1@foo.com You can't send a message on beha

对于一个应用程序,我们希望为用户提供生成的EML,他们可以在Outlook 2010中打开并在对邮件内容进行最小更改或添加附件或收件人后发送。在生成EML时,我们设置的一项内容是“发件人”地址,我们将其设置为邮箱。所有用户都可以访问此邮箱,但当他们打开EML并尝试发送它时,总会返回一个错误:

Delivery has failed to these recipients or groups:

recipient1@foo.com
You can't send a message on behalf of this user unless you have permission to do so. Please make sure you're sending on behalf of the correct sender, or request the necessary permission. If the problem continues, please contact your helpdesk.
但是,如果用户打开邮件,通过在“发件人”组合框中选择邮箱来手动设置邮箱(请注意,电子邮件中没有任何可视更改),然后发送邮件,则邮件成功传递。在我看来,为了成功地指定“发件人”地址,我在EML中缺少了一些东西。我相信,只要打开邮件的用户能够访问邮箱,邮件就应该能够成功发送

EML的一个示例如下所示:

From: Test-Mailbox@foo.com
To: recipient1@foo.com, recipient2@foo.com
Cc: ccRecipient@foo.com
Bcc: bccRecipient@foo.com
Message-ID: <29094346.1.1409121155408.JavaMail.tester@wd34376>
Subject: subject
MIME-Version: 1.0
Content-Type: multipart/related; 
boundary="----=_Part_0_30562042.1409121155299"
X-Unsent: 1

------=_Part_0_30562042.1409121155299
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

body goes here
------=_Part_0_30562042.1409121155299--
From:Test-Mailbox@foo.com
致:recipient1@foo.com, recipient2@foo.com
复写的副本:ccRecipient@foo.com
密件抄送:bccRecipient@foo.com
消息ID:
主题:主题
MIME版本:1.0
内容类型:多部分/相关;
boundary=“---=\u Part\u 0\u 30562042.1409121155299”
X-Unsent:1
------=_部分_0_30562042.1409121155299
内容类型:text/html;字符集=UTF-8
内容传输编码:引用可打印
尸体在这里
------=_部分_0_30562042.1409121155299--

我找到了一种方法,可以正确地将邮箱设置为发件人,但这涉及到在Outlook的VB中通过在MailItem的打开事件中设置SentonBehalfName来指定宏。不完全是我的首选解决方案…

请注意,当您不设置From标题时,它确实有效。在这种情况下,Outlook返回默认发件人地址。显然,您明确希望在您的案例中设置发件人,但此信息对于可以使用默认发件人地址的人仍然有用。