本文介绍了MailAddress字符串格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我将电子邮件功能放入我使用C#制作的网络应用程序中。我很难找到正确格式的电子邮件

地址。我想在字符串中放置多个地址,但是

我尝试的一切都不起作用。

这是我的代码:

protected void SendEmail_Click (对象发送者,EventArgs e)

{

string emailSubject =" Test Subject" ;;

string emailTo =" emailaddress1; emailaddress2" ;

string emailFrom =" emailaddress";

string emailBody =" Test Email";

string SMTPServer =" localhost" ;;


this.SendReminderEmail(this.Context,emailSubject,emailTo,

emailFrom,emailBody,SMTPServer);

}


显然我会替换emailaddress1有了一个真实的电子邮件地址,我只是出于安全原因而忽略了电子邮件地址。我试过

没有空格分号,分号有空格,逗号没有

空格,逗号有空格,可以分割电子邮件地址。没有什么

有效。

谢谢。

Greg

Hello,
I am putting email function into a web app I am making using C#. I am
struggling to find out the proper format for the string of To email
addresses. I want to put multiple addresses in the string, but
everything I try does not work.
Here is my code:
protected void SendEmail_Click(object sender, EventArgs e)
{
string emailSubject = "Test Subject";
string emailTo = "emailaddress1;emailaddress2";
string emailFrom = "emailaddress";
string emailBody = "Test Email";
string SMTPServer = "localhost";

this.SendReminderEmail(this.Context, emailSubject, emailTo,
emailFrom, emailBody, SMTPServer);
}

Obviously I will replace "emailaddress1" with a real email address, I
just left out the email addresses for security reasons. I have tried
putting semicolon with no space, semicolon with a space, comma with no
space, and comma with a space, to divide the email addresses. Nothing
works.
Thanks.
Greg

推荐答案




这篇关于MailAddress字符串格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 22:54