SMTP:将发件人电子邮件ID更改为虚拟。 [英] SMTP : Change sender email id to dummy.
问题描述
希望你们表现得很好!!!
在我的一个项目中我正在使用SMTP客户端发送邮件。
我的SMTP主机是:smtp.bizmail.yahoo.com。
我正在使用发件人邮件ID为 original@ABC.com 并且存在。
我希望当用户收到此邮件时,应显示发件人邮件ID as welcomemail@ABC.com ,这个是虚拟邮件ID。
我试过了displayName属性,它显示了显示名称,但仍然原始发件人邮件ID完好无损。
你能指导我吗?。
谢谢,
Hemant Thakar。
Hi ,
Hope u are doing well !!!
In one of my projects I am using SMTP client for sending mail.
My SMTP Host is : smtp.bizmail.yahoo.com.
I am using sender mail id as original@ABC.com and which exists.
I want when the user receive this mail the sender mail id should be shown as welcomemail@ABC.com and this one is dummy mail id.
I have tried for displayName property, it shows display name but still original sender mail id is intact.
Can you please guide me for this ?.
Thanks,
Hemant Thakar.
推荐答案
为MailMessage类的From属性创建MailAddress实例时例如,有一个覆盖构造函数可以做到这一点: http://msdn.microsoft.com/en-us /升ibrary / 1s17zfkf.aspx [ ^ ]
这里有一个通用的例程:使用或不使用附件在C#中发送电子邮件:通用例程。 [ ^ ]
When you create the MailAddress instance for the From property of the MailMessage class instance, there is an override constructor that does that: http://msdn.microsoft.com/en-us/library/1s17zfkf.aspx[^]
There is a generic routine that includes it here: Sending an Email in C# with or without attachments: generic routine.[^]
这篇关于SMTP:将发件人电子邮件ID更改为虚拟。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!