I want to send emails in C # using the SMTP client. I am currently using this code:
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage (); Message.To.Add ("Receiver"); Message.Subject = ""; Message.From = New System.Net.Mail.MailAddress ("Sender"); message. Body = "this is a test match"; System.Net.Mail.SmtpClient smtp = New System.Net.Mail.SmtpClient ("smtp.gmail.com"); Smtp.Credentials = New System.Net.NetworkCredential ("username", "password"); Smtp.Port = 587; Smtp.EnableSsl = true; Smtp.Send (message); But I want to send mail only by providing the sender address and using the username and password. Is this possible in C #? Is it possible with any SMTP server (not Google) I mean log in anonymously on the server and just provide your mail address.
No Gmail allows anonymous senders. Thank God. If it is possible then it is possible that anyone can pretend to send email from everyone, can provide Gmail as a big spam engine.
Comments
Post a Comment