473,396 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 = "fr*****@blabla.com"
msgMail.To = "to***@tobla.com"
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?
Apr 19 '06 #1
1 1210
Either you forgot to import System.Web.Mail "Imports System.Web.Mail" or
you miss-spelt the class name
"Brandon" <Br*****@discussions.microsoft.com> wrote in message
news:97**********************************@microsof t.com...
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 = "fr*****@blabla.com"
msgMail.To = "to***@tobla.com"
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?

Apr 19 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: humbads | last post by:
How can I trigger the default Apache 404 error from PHP? I don't want to specify a custom handler, I want the default handler. The reason is that I am using mod_rewrite with Apache for my site. ...
2
by: Angelo | last post by:
I would like to create some kind of downloadmanager in c#. When right-click on a link on a website I would like to have an extra option with: "Download with custom program" I already found...
6
by: Jaret Brower | last post by:
When I do a Socket.Send(byte) from a client, how do I know that I've reached the end of this data on the server? I've tried sending the length(4 bytes) at the beginning of the byte but I can't...
9
by: eswanson | last post by:
I have a web page I need to post a file plus some other fields to it. How can I do this from a asp.net page. I know I can send individual fields to the other page, but how do I send a file to the...
10
by: Mike Charney | last post by:
Is there a simple way to send SMTP email from Access VBA? Mike m charney at dunlap hospital dot org
1
by: Mr T | last post by:
I know how to send email from Access and I know how to create a custom form in Outlook. but.... How do I put the email info from Access into the Outlook custom form ??? Dim MyDB As Database Dim...
2
by: Ahmad Jalil Qarshi | last post by:
Hi, I have developed a C# desktop application. In that application I have to send a specific custom message (a string) to a Web Server. Kindly let me know how to achieve this task in C#. A...
17
by: rdemyan | last post by:
My app creates a building report. My users have requested that I provide functionality to e-mail these "building reports" to building managers once a month. So assuming that I have the...
2
by: Mesan | last post by:
Hello everyone, Thanks to many useful posts in this newsgroup and others, I've been able to come very close to something I've been wanting to do for a very long time. I've figured out how to...
1
by: =?Utf-8?B?UnVp?= | last post by:
Can I override the send and receive methods on a web service proxy? I want to use the default proxy classes generated when I add a reference to a web service to create and read the SOAP messages...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.