TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
narasiman rao
NA
519
771.8k
Using Two email id i want to send the mail to gridview data
Jan 19 2016 10:34 PM
try
{
foreach (GridViewRow gv in GDStudents.Rows)
{
if (gv.Cells[5].Text != "";)
{
EmailChange:
string fromEmailid = " ";
if (Email_NO == 1)
fromEmailid = "
[email protected]
";
else if (Email_NO == 2)
fromEmailid ="
[email protected]
";
else
fromEmailid ="";
MailMessage mailmess = new MailMessage();
SmtpClient smtpserver = new SmtpClient("smtp.gmail.com");
smtpserver.Credentials = new NetworkCredential("
[email protected]
","1234");
smtpserver.Host = "smtp.gmail.com";
smtpserver.Port = 587;
smtpserver.EnableSsl = true;
mailmess.From = new MailAddress("
[email protected]
","Confirmation");
mailmess.IsBodyHtml = true;
mailmess.Subject = "ConfirmationMail";
string body2 = "<table>";
body2 = body2 + "<tr><td><b>Dear <font color='Maroon'><b>" + gv.Cells[1].Text.ToString().Trim() + ",</font></td></tr>";
body2 = body2 + "<tr><td><br/> <font face='Arial' size='2' color='Navy'><b> " + TxtMessage.Text.ToString().Trim() + " </font></td></tr>";
body2 = body2 + "</table>";
mailmess.Body = body2;
mm.To.Add(new MailAddress(gv.Cells[5].Text.ToString().Trim()));
Thread threademail = new Thread(delegate()
{
sc.Send(mm);
});
threademail.IsBackground = true;
threademail.Start();
}
}
catch (Exception e11)
{ }
i am sending mail the below Gridview data to send mail.
txtmessage.text = "Dear Students, Thanks for booking the course";
In run mode In gridview as follows
StudentName Email
Rakesh
[email protected]
Magesh
[email protected]
i want to send the mail to rakesh from
[email protected]
and
i want to send the mail to Magesh from
[email protected]
i written the code to send mail but i want to send mail to rakesh from
[email protected]
and i want to send the mail to magesh from
[email protected]
for that how can i do in asp.net using c#.
Reply
Answers (
1
)
Paint Bucket function code in C# ,hangs when running
how do i get data from xml