473,320 Members | 1,969 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,320 software developers and data experts.

Emailing from app - Help!

Hello -

I am attempting to email error messages to myself in the event of an error.
I am using the following code:

Dim mail as New MailMessage()
Dim ErrorMessage = "The error description is as follows: " &
Server.GetLastError.ToString
mail.To = "my****@earthlink.net"
mail.From = "my****@earthlink.net"
mail.Subject = "Error in the Site"
mail.Priority = MailPriority.High
mail.BodyFormat = MailFormat.Text
mail.Body = ErrorMessage
mail.Body = "Testing Email from App"
SmtpMail.Send(mail)

I originally put it in the global.asax under Sub Application_Error(ByVal,
etc.) and included at the top:
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.Mail

I received nothing . . . nada . . . no email, no error message, nothing. I
then attempted to just email myself from a plain old aspx page, putting the
code in the click event of a button and taking out the error message
referrals. I still receive nothing. On debugging, it is showing that
everything is fine.

Next I tried sending to someone else on another pc, using their address in
the "To" portion. Again . . . nothing. I'm running Outlook and have no
problems emailing myself or the other PC from there.

I am using Visual Studio in an XP operating system. Is there some setting
somewhere I should check? Is there something drastically wrong with my code
above?

Any help you can give me will be greatly appreciated! This is starting to
drive me crazy . . .

--
Sandy
Nov 19 '05 #1
3 1479
Hi Sandy,

you need to have access to a SMTP Mail-Server and provide those information,
to be able to send emails using the system.web.mail class.

SmtpMail.SmtpServer = "smtp.mailserver.whatever"

Regards,

Tom
"Sandy" <Sa***@discussions.microsoft.com> schrieb im Newsbeitrag
news:45**********************************@microsof t.com...
Hello -

I am attempting to email error messages to myself in the event of an
error.
I am using the following code:

Dim mail as New MailMessage()
Dim ErrorMessage = "The error description is as follows: " &
Server.GetLastError.ToString
mail.To = "my****@earthlink.net"
mail.From = "my****@earthlink.net"
mail.Subject = "Error in the Site"
mail.Priority = MailPriority.High
mail.BodyFormat = MailFormat.Text
mail.Body = ErrorMessage
mail.Body = "Testing Email from App"
SmtpMail.Send(mail)

I originally put it in the global.asax under Sub Application_Error(ByVal,
etc.) and included at the top:
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.Mail

I received nothing . . . nada . . . no email, no error message, nothing.
I
then attempted to just email myself from a plain old aspx page, putting
the
code in the click event of a button and taking out the error message
referrals. I still receive nothing. On debugging, it is showing that
everything is fine.

Next I tried sending to someone else on another pc, using their address in
the "To" portion. Again . . . nothing. I'm running Outlook and have no
problems emailing myself or the other PC from there.

I am using Visual Studio in an XP operating system. Is there some setting
somewhere I should check? Is there something drastically wrong with my
code
above?

Any help you can give me will be greatly appreciated! This is starting to
drive me crazy . . .

--
Sandy

Nov 19 '05 #2
Thanks for your reply, Tom.

Does that mean I have to install something like Exchange Server? I'm
currently only running Windows XP Professional. I have a mail account with
earthlink.net. I thought perhaps because I am able to email myself through
earthlink, I might be able to programmatically email myself.

I just wanted to be able to test the code for the time being until I get to
the point where I actually get a host, etc.

Sandy

"TomEgginger" wrote:
Hi Sandy,

you need to have access to a SMTP Mail-Server and provide those information,
to be able to send emails using the system.web.mail class.

SmtpMail.SmtpServer = "smtp.mailserver.whatever"

Regards,

Tom
"Sandy" <Sa***@discussions.microsoft.com> schrieb im Newsbeitrag
news:45**********************************@microsof t.com...
Hello -

I am attempting to email error messages to myself in the event of an
error.
I am using the following code:

Dim mail as New MailMessage()
Dim ErrorMessage = "The error description is as follows: " &
Server.GetLastError.ToString
mail.To = "my****@earthlink.net"
mail.From = "my****@earthlink.net"
mail.Subject = "Error in the Site"
mail.Priority = MailPriority.High
mail.BodyFormat = MailFormat.Text
mail.Body = ErrorMessage
mail.Body = "Testing Email from App"
SmtpMail.Send(mail)

I originally put it in the global.asax under Sub Application_Error(ByVal,
etc.) and included at the top:
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.Mail

I received nothing . . . nada . . . no email, no error message, nothing.
I
then attempted to just email myself from a plain old aspx page, putting
the
code in the click event of a button and taking out the error message
referrals. I still receive nothing. On debugging, it is showing that
everything is fine.

Next I tried sending to someone else on another pc, using their address in
the "To" portion. Again . . . nothing. I'm running Outlook and have no
problems emailing myself or the other PC from there.

I am using Visual Studio in an XP operating system. Is there some setting
somewhere I should check? Is there something drastically wrong with my
code
above?

Any help you can give me will be greatly appreciated! This is starting to
drive me crazy . . .

--
Sandy


Nov 19 '05 #3
Hi Tom -

Please disregard my previous reply. I got it to work. Thanks so much!

Sandy

"TomEgginger" wrote:
Hi Sandy,

you need to have access to a SMTP Mail-Server and provide those information,
to be able to send emails using the system.web.mail class.

SmtpMail.SmtpServer = "smtp.mailserver.whatever"

Regards,

Tom
"Sandy" <Sa***@discussions.microsoft.com> schrieb im Newsbeitrag
news:45**********************************@microsof t.com...
Hello -

I am attempting to email error messages to myself in the event of an
error.
I am using the following code:

Dim mail as New MailMessage()
Dim ErrorMessage = "The error description is as follows: " &
Server.GetLastError.ToString
mail.To = "my****@earthlink.net"
mail.From = "my****@earthlink.net"
mail.Subject = "Error in the Site"
mail.Priority = MailPriority.High
mail.BodyFormat = MailFormat.Text
mail.Body = ErrorMessage
mail.Body = "Testing Email from App"
SmtpMail.Send(mail)

I originally put it in the global.asax under Sub Application_Error(ByVal,
etc.) and included at the top:
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.Mail

I received nothing . . . nada . . . no email, no error message, nothing.
I
then attempted to just email myself from a plain old aspx page, putting
the
code in the click event of a button and taking out the error message
referrals. I still receive nothing. On debugging, it is showing that
everything is fine.

Next I tried sending to someone else on another pc, using their address in
the "To" portion. Again . . . nothing. I'm running Outlook and have no
problems emailing myself or the other PC from there.

I am using Visual Studio in an XP operating system. Is there some setting
somewhere I should check? Is there something drastically wrong with my
code
above?

Any help you can give me will be greatly appreciated! This is starting to
drive me crazy . . .

--
Sandy


Nov 19 '05 #4

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

Similar topics

2
by: Paul Hudson | last post by:
Ive developed a web based system where somebody can add a news record using ASP and MS Access database connectivity. The new record is inserted into the database and then a formatted email gets...
1
by: Bob-O | last post by:
Need your help in sending an email message with an attachment in my VB.Net program. Sending a body message is no problem. I don't know how to use the attachment property in an emai Following is...
1
by: Stanley Cheung | last post by:
Hi all, I am developing the application for send emailing list, actually, i can perform to send a email 1 by 1 and do it on aspx page. I have a enquiry that how can the application change to...
5
by: Colin Anderson | last post by:
I discovered, with great excitement, this article http://www.davison.uk.net/vb2notes.asp when researching methods for emailing from Access via Notes. Unfortunatly, when I run this I get a...
1
by: Alfie | last post by:
I've got a form, and I'm trying to set up a way of emailing from it. Does anyone know, if I've got an email address in a field called , is there a way that I could create a command button which,...
3
by: tafs7 | last post by:
My code below is supposed to email me when an error occurs on the application, but it's not emailing anything. Am I missing something? I know the smtp servers I've tried work. I even added a...
4
by: Farooq Khan | last post by:
hi, i'm using CDONTS component for emailing through one of my web service like this // Start of code // 'email' is the CDONTS object name email.send(EmailFrom.ToString(), EmailTo.ToString(),...
4
by: Mike Moore | last post by:
What is the best way to launch outlook from an asp.net web page? Can you do this using MAPI or is there a control that you can purchase? We are unable to use SMTP. We use MS Exhange and MAPI...
20
by: paul814 | last post by:
I've been working on this for some time now and have gotten nowhere...hoping someone here can help. I want to take and email all records in a database for the current date when this php page is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.