Hello,
I am trying to send email to 4 people (str01 =
"p1.mysite.com,p2.mysite.com,p3.mysite.com") using the following:
Dim addrFrom As New MailAddress(str00)
Dim addrTo As New MailAddress(str01)
My problem is that only the first person receives the email. When I check
the variable addrTo the value is "p1.mysite.com". Any help with this would
be appreciated.
--
Thanks in advance,
sck10A mailAddress is used for a single person, the To property of the
MailMessage is actually a collection...
ur supposed to do:
myMessage.To.Add(new MailAddress("email1'))
myMessage.To.Add(new MailAddress("email2'))
myMessage.To.Add(new MailAddress("email3'))
Karl
http://www.openmymind.net/
http://www.fuelindustries.com/
"sck10" <sck10@.online.nospam> wrote in message
news:eyEDvZOWGHA.4924@.TK2MSFTNGP05.phx.gbl...
> Hello,
> I am trying to send email to 4 people (str01 =
> "p1.mysite.com,p2.mysite.com,p3.mysite.com") using the following:
> Dim addrFrom As New MailAddress(str00)
> Dim addrTo As New MailAddress(str01)
> My problem is that only the first person receives the email. When I check
> the variable addrTo the value is "p1.mysite.com". Any help with this
> would
> be appreciated.
> --
> Thanks in advance,
> sck10
>
Mail recipients can also be added using the cc and bcc attributes.
static void MultipleRecipients()
{
//create the mail message
MailMessage mail = new MailMessage();
//set the addresses
//to specify a friendly 'from' name, we use a different ctor
mail.From = new MailAddress("me@.company.com", "Me");
//since the To,Cc, and Bcc accept addresses,
//we can use the same technique as the From address
//since the To, Cc, and Bcc properties are collections,
//to add multiple addreses, we simply call .Add(...) multple times
mail.To.Add("you@.yourcompany.com");
mail.To.Add("you2@.yourcompany.com");
mail.CC.Add("cc1@.yourcompany.com");
mail.CC.Add("cc2@.yourcompany.com");
mail.Bcc.Add("blindcc1@.yourcompany.com");
mail.Bcc.Add("blindcc2@.yourcompany.com");
//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";
//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Karl Seguin [MVP]" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME net> wro
te in message
news:eN2MefOWGHA.924@.TK2MSFTNGP03.phx.gbl...
>A mailAddress is used for a single person, the To property of the MailMessa
ge is actually a
>collection...
> ur supposed to do:
> myMessage.To.Add(new MailAddress("email1'))
> myMessage.To.Add(new MailAddress("email2'))
> myMessage.To.Add(new MailAddress("email3'))
> Karl
> --
> http://www.openmymind.net/
> http://www.fuelindustries.com/
>
> "sck10" <sck10@.online.nospam> wrote in message news:eyEDvZOWGHA.4924@.TK2MS
FTNGP05.phx.gbl...
>
OT: Can you retrieve your email address from the smtp web.config?
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:uFZL2pOWGHA.752@.TK2MSFTNGP02.phx.gbl...
> Mail recipients can also be added using the cc and bcc attributes.
> static void MultipleRecipients()
> {
> //create the mail message
> MailMessage mail = new MailMessage();
> //set the addresses
> //to specify a friendly 'from' name, we use a different ctor
> mail.From = new MailAddress("me@.company.com", "Me");
> //since the To,Cc, and Bcc accept addresses,
> //we can use the same technique as the From address
> //since the To, Cc, and Bcc properties are collections,
> //to add multiple addreses, we simply call .Add(...) multple times
> mail.To.Add("you@.yourcompany.com");
> mail.To.Add("you2@.yourcompany.com");
> mail.CC.Add("cc1@.yourcompany.com");
> mail.CC.Add("cc2@.yourcompany.com");
> mail.Bcc.Add("blindcc1@.yourcompany.com");
> mail.Bcc.Add("blindcc2@.yourcompany.com");
> //set the content
> mail.Subject = "This is an email";
> mail.Body = "this is the body content of the email.";
> //send the message
> SmtpClient smtp = new SmtpClient("127.0.0.1");
> smtp.Send(mail);
> }
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaol : http://asp.net.do/foros/
> ===================================
> "Karl Seguin [MVP]" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME
> net> wrote in message news:eN2MefOWGHA.924@.TK2MSFTNGP03.phx.gbl...
>
Hello, VickZaro.
The pattern to follow is this one :
<myGroup>
<nestedGroup>
<mySection>
<add key="key_one" value="1"/>
<add key="key_two" value="2"/>
</mySection>
</nestedGroup>
</myGroup>
</configuration>
You can read the value of the configuration section defined in the preceding
example as follows:
Dim config As NameValueCollection=ConfigurationSetting
s.GetConfig("myGroup/n
estedGroup/mySection")
Response.Write("The value of key_one is " & Server.HtmlEncode(config("key_on
e")) & "<br>")
Response.Write("The value of key_two is " & Server.HtmlEncode(config("key_tw
o")) )
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"VickZaro" <VickZaro2112@.hotmail.com> wrote in message
news:LzXYf.94692$6Q2.1609125@.weber.videotron.net...
> OT: Can you retrieve your email address from the smtp web.config?
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:uFZL2pOWGHA.752@.TK2MSFTNGP02.phx.gbl...
>
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment