WebMail.Send(to: "someone@somewhere.com", subject: "email subject", body: "message body, isBodyHtml: false );
WebMail.SmtpServer = "smtp.gmail.com";
WebMail.SmtpPort = 587;
WebMail.EnableSsl = true;
WebMail.UserName = "me@mydomain.com";
WebMail.Password = "the password";
WebMail.From = "me@mydomain.com";
By using the above method, I am receiving email from sender name as "me@mydomain.com".. I tried changing the parameters "userName" and "From", but the gmail server rejects the message.
What parameter to add to receive email from a sender name instead of email id..