web service?
-
Hi friends, i have one query ,using one of my webmethod i need to send mail. for this i used this code StringBuilder mailMessage1 = new StringBuilder(reader1.ReadToEnd()); MailMessage msgMail1 = new MailMessage(); from = "abc@y.com"; msgMail1.From = new MailAddress(from); msgMail1.To.Add(new MailAddress(toID));//toID coming from database msgMail1.Priority = MailPriority.High; msgMail1.Subject = "Service Next:Ticket No" + "" + ticketID; msgMail1.Body = mailMessage1.ToString(); msgMail1.IsBodyHtml = true; SmtpClient smtpClient1 = new SmtpClient(); smtpClient1.Host = "172.17.0.16"; smtpClient1.Send(msgMail1); problem is in my database toID has 2 values 1.mail format(ex:x@y.com) 1.Not Available if toID=mail format means i can send mails perfectly and i am returning flag from database if toID=Not Available means i am getting error (ex:email is not in correct format)i am not returning any flag. if toID=Not Available means i need to send message through webmethod . how to do this ,if anybody have idea please help me Regards RamaDevi.
samrama