But i want a...@a.com;b...@b.com;
i don't need the extra semicolon
Thanks
code below
------
while (oledr.Read())
{
smail = oledr[0].ToString() + ";" + "<br>";
//smail += oledr[0].ToString() & ";";
//mail.To.Add(smail);
//this.Label1.Text = smail;
Response.Write(smail);
}
bool firstTime = true;
while (oledr.Read())
{
smail ="";
if(!firstTime) smail = ";"
smail += oledr[0].ToString();
}
--
/// ------------------------------
/// Braulio Diez
///
/// http://www.tipsdotnet.com
/// ------------------------------
smail ="";
while (oledr.Read())
{
if(smail.Length > 0) smail += ";"
smail += oledr[0].ToString();
}
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Braulio Diez" <braulio1...@yahoo.es> wrote in message
news:23ABCE93-79BB-4B4B...@microsoft.com...
while (oledr.Read())
{
string smail;
smail = "";
if (!firstTime)smail = ";";
//smail = oledr[0].ToString();
smail += oledr[0].ToString();
//mail.To.Add(smail);
Response.Write(smail);
}
But didn't solve the problem
"Braulio Diez" <braulio1...@yahoo.es> wrote in message
news:23ABCE93-79BB-4B4B...@microsoft.com...
"Eliyahu Goldin" <REMOVEALLCAPIT...@mMvVpPsS.org> wrote in
message news:efC6z25n...@TK2MSFTNGP02.phx.gbl...
> Response.Write(smail);
Response.Write(smail.TrimEnd(';'));
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Anu ideas this is driving me nuts
Thanks Mark
[MVP]" <ma...@markNOSPAMrae.net> wrote in message
news:eusljb6n...@TK2MSFTNGP04.phx.gbl...
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Mark Rae [MVP]" <ma...@markNOSPAMrae.net> wrote in message
news:eusljb6n...@TK2MSFTNGP04.phx.gbl...
> Error
> The specified string is not in the form required for an e-mail address.
> is it "; "or ", "
> tried all with no success
> Using
> using System.Net.Mail;
>
> Any ideas this is driving me nuts
Oh right - now I see what you're trying to do...
while (oledr.Read())
{
mail.To.Add(oledr[0].ToString());
}
http://www.systemnetmail.com/faq/3.2.3.aspx
"Mark Rae [MVP]" <ma...@markNOSPAMrae.net> wrote in message
news:%23unJsp6...@TK2MSFTNGP05.phx.gbl...
"rote" <naija...@hotmail.com> wrote in message
news:uavDyvBo...@TK2MSFTNGP06.phx.gbl...
>>>> Any ideas this is driving me nuts
>>>
>>> Oh right - now I see what you're trying to do...
>>>
>>> while (oledr.Read())
>>> {
>>> mail.To.Add(oledr[0].ToString());
>>> }
>>>
>>> http://www.systemnetmail.com/faq/3.2.3.aspx
>>
>> Thanks but when i do that i get error:
>> The parameter 'addresses' cannot be an empty string.
>> Parameter name: addresses
>
> Actually got it to work.
> This is very confusing between System.Web.Mail and System.Net.Mail
> I remembered when using System.Web.Mail i had to include a semi colon or
> comma
> But it seems System.Net.Mail doesn't need it .
That's right. In System.Net.Mail, the .To, .Cc and .Bcc properties are
collections, not strings, so they don't require anything to "separate" the
individual addresses... That's why the code I gave you above doesn't include
a semi-colon at the end of the addresses...