- הוסף לסימניות
- #1
יש לי שאלה לגבי שליחת סיסמא לאמייל.
תמיד השתמשתי בקוד למטה כדי לשלוח לאמייל
פה יש לי 2 בעיות
1. אני לא בטוחה שהאמייל יהיה מסוג gmail.
2. אני לא אדע מה הסיסמא של מי שיקבל את האמייל.
שאלתי איך ניתן לשלוח סיסמא לאמייל שיפתור את הבעיות הנ"ל.
תודה מראש

הקוד:
תמיד השתמשתי בקוד למטה כדי לשלוח לאמייל
פה יש לי 2 בעיות
1. אני לא בטוחה שהאמייל יהיה מסוג gmail.
2. אני לא אדע מה הסיסמא של מי שיקבל את האמייל.
שאלתי איך ניתן לשלוח סיסמא לאמייל שיפתור את הבעיות הנ"ל.
תודה מראש
הקוד:
קוד:
string Host = "smtp.gmail.com";
Int16 Port = 587;
bool SSL = true;
string Username = "<לא ניתן לפרסם מיילים באופן פומבי>";
string Password = "11111111";
//of this person
string strMail = Request["email"];
string massg = Request["massage"];
// Mail options
string To = strMail;
string From = "from";
string Subject = "sub";
string Body = "body";
MailMessage mm = new MailMessage(From, To, Subject, Body);
SmtpClient sc = new SmtpClient(Host, Port);
NetworkCredential netCred = new NetworkCredential(Username, Password);
sc.EnableSsl = SSL;
sc.UseDefaultCredentials = false;
sc.Credentials = netCred;
try
{
Console.WriteLine("Sending e-mail message...");
sc.Send(mm);
}
catch (Exception ex)
{
Console.WriteLine("Error: {0}", ex.ToString());
}
הנושאים החמים