We are using asp.net 3.5 with c#.We have to make an powerful mailer module.This module can mail more than 15000 recipient or in short all records in DBMS.I would like to ask few things.
1)We have a code which sends a mail to single recipient.How will we send a mail to multiple recipient.I tried with our code to add more than one email id by ',' but it sends only first email id.Here is the code sample
public bool Mail(string to, string subject, string body)
{
try
{
MailMessage objEmail = new MailMessage();
objEmail.To =to;
objEmail.From = "[email protected]";
//objEmail.Priority =priority
objEmail.Subject = subject;
objEmail.Body = body;
//enable the Html tag...
objEmail.BodyFormat = MailFormat.Html;
objEmail.Priority = MailPriority.High;
SmtpMail.SmtpServer = "localhost";
try
{
SmtpMail.Send(objEmail);
return true;
}
catch(Exception ex)
{
string error = ex.StackTrace;
return false;
}
}
catch
{
return false;
}
}
2)What is the max limit to send mail at a time.Means how much value we can assign in string to that contains emailids?
3)One main thing our code is in button click so if we have more than 15000 records so will it able to send to mail all because What we are thinking is that page will have 60sec to render so it may send mails only those ids cover in 60 sec.
Lets suggest what is the best way to do that.
Thanks in advance.
To
orCC
fields. Else you're giving your users the email addresses of other users. – Deadly