UHCL Banner

Sending SMTP Email

The DCM server no longer has an SMTP server due to security issues. We suggest that you use a free gmail account to send your email.

ASP.NET Example

In web.config

<smtp deliveryMethod="Network" from="username@gmail.com">
<network defaultCredentials="false" host="smtp.gmail.com" port="587" userName="username@gmail.com" password="******" />

In .cs file

protected void PasswordRecovery1_SendingMail(object sender, MailMessageEventArgs e)
MailMessage mm = new MailMessage();
mm.From = e.Message.From;
mm.Subject = e.Message.Subject.ToString();
mm.Body = e.Message.Body;
SmtpClient smtp = new SmtpClient();
smtp.EnableSsl = true;
e.Cancel = true;