1
Answer

How to attach a random number with an email using Wcf servic

I want to how to attach a random number with an email by using wcf service
 

Answers (1)

0
Photo of Manas Mohapatra
NA 29.3k 3.3m 9y
Guid g = Guid.NewGuid();
string strPassword = Guid.NewGuid().ToString("N").Substring(0, 12);
 
MailMessage mail = new MailMessage();
mail.To.Add(txt_Email.Text);
mail.Subject = "About the confirmation of your registration.";
string Body = "Welcome to C# Corner! " + " ,this is your confirmation code: " + strPassword;
mail.Body = Body;
mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.EnableSsl = true;
smtp.Send(mail);
 
If it doesn't resolve your problem please your problem more details.