Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > send email with .net code

Reply
Thread Tools

send email with .net code

 
 
=?Utf-8?B?ZnJhbms=?=
Guest
Posts: n/a
 
      08-31-2006
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("")

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

myMessage.To = toAddr
myMessage.From = ""
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
---------------
 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      08-31-2006
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" <> wrote in message
news:10F0F109-FF99-40EA-949F-...
>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("")
>
> Public Function SendMail(ByVal toAddr As String) As Boolean
> Dim myMessage As New MailMessage
>
> myMessage.To = toAddr
> myMessage.From = ""
> 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
> ---------------



 
Reply With Quote
 
 
 
 
Mark Rae
Guest
Posts: n/a
 
      08-31-2006
"frank" <> wrote in message
news:10F0F109-FF99-40EA-949F-...

>I need help please!


http://www.systemwebmail.com
http://www.systemnetmail.com


 
Reply With Quote
 
sloan
Guest
Posts: n/a
 
      09-01-2006
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" <> wrote in message
news:10F0F109-FF99-40EA-949F-...
> 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("")
>
> Public Function SendMail(ByVal toAddr As String) As Boolean
> Dim myMessage As New MailMessage
>
> myMessage.To = toAddr
> myMessage.From = ""
> 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
> ---------------



 
Reply With Quote
 
 
 
Reply

Thread Tools

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
which email module - MIME::LITE, Email::Send, other? brewsterbear@googlemail.com Perl Misc 2 01-05-2007 09:45 AM
How to have email form send email and start file download bmurphy@xlrotor.com Javascript 13 05-14-2006 06:27 PM
Cannot compose ,reply or send email on Sasktel email system pcbutts1 Computer Support 5 07-29-2005 06:13 AM
why cant i send email messages from this email Billie Jo Ames Computer Support 8 06-30-2005 12:24 PM
HowTo:? open email client to send email Peter ASP .Net 0 07-01-2003 04:58 PM



Advertisments