473,789 Members | 3,123 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.GetLastE rror.ToString
mail.To = "my****@earthli nk.net"
mail.From = "my****@earthli nk.net"
mail.Subject = "Error in the Site"
mail.Priority = MailPriority.Hi gh
mail.BodyFormat = MailFormat.Text
mail.Body = ErrorMessage
mail.Body = "Testing Email from App"
SmtpMail.Send(m ail)

I originally put it in the global.asax under Sub Application_Err or(ByVal,
etc.) and included at the top:
Imports System.Web
Imports System.Web.Sess ionState
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 1496
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.SmtpSe rver = "smtp.mailserve r.whatever"

Regards,

Tom
"Sandy" <Sa***@discussi ons.microsoft.c om> schrieb im Newsbeitrag
news:45******** *************** ***********@mic rosoft.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.GetLastE rror.ToString
mail.To = "my****@earthli nk.net"
mail.From = "my****@earthli nk.net"
mail.Subject = "Error in the Site"
mail.Priority = MailPriority.Hi gh
mail.BodyFormat = MailFormat.Text
mail.Body = ErrorMessage
mail.Body = "Testing Email from App"
SmtpMail.Send(m ail)

I originally put it in the global.asax under Sub Application_Err or(ByVal,
etc.) and included at the top:
Imports System.Web
Imports System.Web.Sess ionState
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 programmaticall y 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

"TomEgginge r" 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.SmtpSe rver = "smtp.mailserve r.whatever"

Regards,

Tom
"Sandy" <Sa***@discussi ons.microsoft.c om> schrieb im Newsbeitrag
news:45******** *************** ***********@mic rosoft.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.GetLastE rror.ToString
mail.To = "my****@earthli nk.net"
mail.From = "my****@earthli nk.net"
mail.Subject = "Error in the Site"
mail.Priority = MailPriority.Hi gh
mail.BodyFormat = MailFormat.Text
mail.Body = ErrorMessage
mail.Body = "Testing Email from App"
SmtpMail.Send(m ail)

I originally put it in the global.asax under Sub Application_Err or(ByVal,
etc.) and included at the top:
Imports System.Web
Imports System.Web.Sess ionState
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

"TomEgginge r" 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.SmtpSe rver = "smtp.mailserve r.whatever"

Regards,

Tom
"Sandy" <Sa***@discussi ons.microsoft.c om> schrieb im Newsbeitrag
news:45******** *************** ***********@mic rosoft.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.GetLastE rror.ToString
mail.To = "my****@earthli nk.net"
mail.From = "my****@earthli nk.net"
mail.Subject = "Error in the Site"
mail.Priority = MailPriority.Hi gh
mail.BodyFormat = MailFormat.Text
mail.Body = ErrorMessage
mail.Body = "Testing Email from App"
SmtpMail.Send(m ail)

I originally put it in the global.asax under Sub Application_Err or(ByVal,
etc.) and included at the top:
Imports System.Web
Imports System.Web.Sess ionState
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
1918
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 send to a list of about 30 email addresses using CDONTS. My emailing ASP script works by looping through a recordset containing the email addresses, the text gets formatted, and then it sends, then moves onto the next recipient etc etc ... I...
1
341
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 an excerpt from the program Imports System.Web.Mai Imports System.Web.HttpServerUtilit Imports System.Diagnostics Public Class Emailin Inherits System.Web.UI Pag
1
1792
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 background task instead of user need to wait and wait until all email sent. Also, when user waiting to complete the emailing list, the page is blank and nothing, can we put a layout when user waiting a request.
5
7386
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 Run-time error. When I run it on an XP machine it crashes, but on an NT box it just generates an unknown error, handled by the error handler. I have debugged and stepped through the code and have narrowed the issue to the point at which the...
1
1396
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, when clicked, would open up an email, with the value from the phone number field dropped into the To field of the email? It would only be for phone numbers with a of 'Email Address'. I know next to nothing about SQL, so would rather do...
3
3039
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 App_Start handler to see if I could get emailed at all even from the first request of the app, but to no avail. Could someone please help me out? Thanks a lot! --Thiago Web developer AgniTEK
4
1449
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(), Subject.ToString(), Body.ToString(), 1)
4
1653
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 currently for our client/server apps.
20
1927
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 run. Now I have a number of tables in this database...looking like this: editorial editorialdate, editorialname, editorialcomments press
0
9665
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10408
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10199
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9983
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9020
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6768
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4092
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.