473,396 Members | 1,792 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.

send email with .net code

I need help please!

I write a method to send email and there is a button on a web page, click
the button will call the method. everything seems ok. but the email never be
sent.
--------------------
button click: SendMail("ka**@vaughan.ca")

Public Function SendMail(ByVal toAddr As String) As Boolean
Dim myMessage As New MailMessage

myMessage.To = toAddr
myMessage.From = "ro**@vaughan.ca"
myMessage.Subject = "Vaughan GIS System"
myMessage.BodyFormat = MailFormat.Text

myMessage.Body = "www.vaughangis.info"

Mail.SmtpMail.SmtpServer = "10.141.140.69"

Try
SmtpMail.Send(myMessage)
Catch ex As Exception
ErrMsg = ex.Message
Return False
End Try
Return True
End Function
---------------
Aug 31 '06 #1
3 1213
1. Make sure you have an SMTP server set up (can be Exchange)
2. Make sure you are configured to use this server
3. Make sure you have rights to relay messages if you are using a server

Any of these can bomb things. If you are using the MS SMTP Server that ships
with the OS, check the mail folder and see if you have stuck messages. If
so, you are contacting the SMTP service, but it is not relaying the messages
(does not know how to send things out). If not, you are not properly
configured to use the SMTP service.

If you are using Exchange or another server option, check with your admin
and see if you are even getting into the system.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
"frank" <fr***@discussions.microsoft.comwrote in message
news:10**********************************@microsof t.com...
>I need help please!

I write a method to send email and there is a button on a web page, click
the button will call the method. everything seems ok. but the email never
be
sent.
--------------------
button click: SendMail("ka**@vaughan.ca")

Public Function SendMail(ByVal toAddr As String) As Boolean
Dim myMessage As New MailMessage

myMessage.To = toAddr
myMessage.From = "ro**@vaughan.ca"
myMessage.Subject = "Vaughan GIS System"
myMessage.BodyFormat = MailFormat.Text

myMessage.Body = "www.vaughangis.info"

Mail.SmtpMail.SmtpServer = "10.141.140.69"

Try
SmtpMail.Send(myMessage)
Catch ex As Exception
ErrMsg = ex.Message
Return False
End Try
Return True
End Function
---------------

Aug 31 '06 #2
"frank" <fr***@discussions.microsoft.comwrote in message
news:10**********************************@microsof t.com...
>I need help please!
http://www.systemwebmail.com
http://www.systemnetmail.com
Aug 31 '06 #3
http://sholliday.spaces.live.com/
2/8/2006 entry

I have 1.1 and 2.0 samples. There is also "authentication" modes you have
to consider.
"frank" <fr***@discussions.microsoft.comwrote in message
news:10**********************************@microsof t.com...
I need help please!

I write a method to send email and there is a button on a web page, click
the button will call the method. everything seems ok. but the email never
be
sent.
--------------------
button click: SendMail("ka**@vaughan.ca")

Public Function SendMail(ByVal toAddr As String) As Boolean
Dim myMessage As New MailMessage

myMessage.To = toAddr
myMessage.From = "ro**@vaughan.ca"
myMessage.Subject = "Vaughan GIS System"
myMessage.BodyFormat = MailFormat.Text

myMessage.Body = "www.vaughangis.info"

Mail.SmtpMail.SmtpServer = "10.141.140.69"

Try
SmtpMail.Send(myMessage)
Catch ex As Exception
ErrMsg = ex.Message
Return False
End Try
Return True
End Function
---------------

Sep 1 '06 #4

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

Similar topics

0
by: David Burson | last post by:
Hi, I have a VB.NET windows app that needs to automatically send a simple text email when my users run a new version of the app for the first time. I thought this would be simple, but after...
6
by: DigitalRick | last post by:
I have been running CDONTS in my ASPpages to send emails to me sent from my guestbook. It had been working fine untill I upgraded to Server 2003 (I am also running Exchange 2003) all locally. I...
9
by: Bob Jones | last post by:
We have developed a commercial ASP.net application (personal nutrition management and tracking); we want to send smtp email from within it. For our development box, we use WinXP Pro, IIS 5.5,...
2
by: Leszek | last post by:
Hello, I have created a simple code to send emails using the MailMessage class and the SmtpMail.Send() method: MailMessage mail = new MailMessage(); mail.From = echidna@somewhere.com; //...
1
by: Miguel Dias Moura | last post by:
Hello, Can you help me out in making this work? What I want is as simple as sending form values to an email. The code I am using is the following:
14
by: supz | last post by:
Hi, I use the standard code given below to send an email from an ASP.NET web form. The code executes fine but no Email is sent. All emails get queued in the Inetpub mail queue. I'm using my...
9
by: Mahernoz | last post by:
Can i send an email from JavaScript? Is it possible? If yes please the code to send email using javascript...
16
by: =?Utf-8?B?Q2hlZg==?= | last post by:
I can use outlook2003 to send email,but I cann't use this code below to send email. Please help me to test this code and instruct me how to solve this problem in detail. software...
2
by: Malli mindwave | last post by:
Hi, We are using the yahoowebHostiing service for my company website, In that one screen of the SendComments/FeedBack section is there, I'm basically dot.net develeoper ,but yahoowebhosting not...
5
by: Mike | last post by:
I have a page with a textbox that a user can enter in mutliple email addresses such as: user1@yahoo.com;user2@yahoo.com;user3@gmail.com; and so on, I then have a foreach loop to get all of the...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.