how to send custom e-mail with asp.net

G

Guest

I am trying to send a custom e-mail using asp.net but am having trouble. The
code that I found to do this is:

<%
Dim msgMail as New MailMessage
msgMail.From = "(e-mail address removed)"
msgMail.To = "(e-mail address removed)"
msgMail.Subject = "Happy Birthday"
msgMail.Body = "If your birthday is today, have a good one."
SmtpMail.SmtpServer = "smtpout.secureserver.net"
SmtpMail.Send(msgMail)
%>

But when I load this page, I get the following error message:

"Type 'MailMessage' is not defined"

Can someone help me out with this?
 
N

Niko

Either you forgot to import System.Web.Mail "Imports System.Web.Mail" or
you miss-spelt the class name
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top