Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - how to send custom e-mail with asp.net

 
Thread Tools Search this Thread
Old 04-19-2006, 02:43 AM   #1
Default how to send custom e-mail with asp.net


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 = ""
msgMail.To = ""
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?


=?Utf-8?B?QnJhbmRvbg==?=
  Reply With Quote
Old 04-19-2006, 09:13 AM   #2
Niko
 
Posts: n/a
Default Re: how to send custom e-mail with asp.net
Either you forgot to import System.Web.Mail "Imports System.Web.Mail" or
you miss-spelt the class name


"Brandon" <> wrote in message
news:970F8B7F-5907-404B-8413-...
>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 = ""
> msgMail.To = ""
> 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?





Niko
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Asp.Net Custom Controls & Safari Compatibility Osiris General Help Related Topics 0 06-01-2009 08:03 PM
ASP.NET: Asign Users in Roles(Array.IndexOf(Of String) method) msandlana Software 0 04-25-2008 06:37 AM
asp.net : custom code to delete data from Grid view (Database) sara_23apr Software 1 06-19-2007 01:08 PM
send and receive SMS with asp.net dev2000 Software 0 10-22-2006 07:25 AM
This is incredible! jc_ice DVD Video 1 08-13-2006 10:47 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46