Ask a Question related to ASP.NET General, Design and Development.
-
Phoebe. #1
Sending mail.
Hi, Good Day!
I am writing a code in order to send a mail out when certain job failed
while running the program. Meanwhile for my testing, I'm either hardcoding
the address or type in on the spot so that the mail will be send as expected
to certain people. The code is as below.
Sub SubmitBtn_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim TheMailMessage As New Mail.MailMessage()
Dim TheMailConnection As SmtpMail
TheMailMessage.From = txtFromEmail.Text
TheMailMessage.To = txtToEmail.Text
TheMailMessage.Subject = txtSubject.Text
TheMailMessage.Body = txtMessage.Text
TheMailConnection.Send(TheMailMessage)
End Sub
What I need is to send the mail automatically when the program facing
error. How shd I do? Can someone help?
Thanks in advanced.
rgds, Phoebe.
Phoebe. Guest
-
sending mail without the mail client popping up
hi! I was wondering how I could send a mail without the mail client popping up to the user. I would like a mail to be sent to myself when... -
#25357 [Com]: Mail() function is loosing cahracters when sending mail
ID: 25357 Comment by: dj_canard at yahoo dot com Reported By: pjsmith at microtech dot co dot gg Status: Bogus... -
#25357 [NEW]: Mail() function is loosing cahracters when sending mail
From: pjsmith at microtech dot co dot gg Operating system: Windows 2003, IIS, ISAPI PHP version: 4.3.3 PHP Bug Type: *Mail... -
sending mail with PWS
Hi all, i use a personal web server and i'd like to send a mail into an ASP page. Usually, i use CDONT component but it seems it does not work on... -
Sending Mail
Shouldn't this code do it on a Win2k3 box. Set oMsg = Server.CreateObject("CDO.Message") oMsg.From = "address@domain.com" oMsg.To =... -
Phoebe. #2
Re: Sending mail.
Thanks Steve.
My main concern is to send out mail without hardcode those emailTo,
emailFrom address. Can i save these email address in a file, maybe like
notepad or something else.
Thanks in advanced.
rgds,
Phoebe.
"Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
news:OkBc0vbUDHA.1280@tk2msftngp13.phx.gbl...hardcoding> One approach would be to put your email code in the Application_OnError
> event.
> Here's more info:
> [url]http://www.ragingsmurf.com/code.aspx?key=K62OO6HIDR[/url]
> [url]http://www.15seconds.com/issue/030102.htm[/url]
>
> --
> I hope this helps,
> Steve C. Orr, MCSD
> [url]http://Steve.Orr.net[/url]
>
>
> "Phoebe." <phoebe8124@hotmail.com> wrote in message
> news:%23%23Ko9UbUDHA.1680@tk2msftngp13.phx.gbl...> > Hi, Good Day!
> >
> > I am writing a code in order to send a mail out when certain job failed
> > while running the program. Meanwhile for my testing, I'm either> expected> > the address or type in on the spot so that the mail will be send as>> > to certain people. The code is as below.
> > Sub SubmitBtn_Click(ByVal sender As Object, ByVal e As EventArgs)
> >
> > Dim TheMailMessage As New Mail.MailMessage()
> >
> > Dim TheMailConnection As SmtpMail
> >
> > TheMailMessage.From = txtFromEmail.Text
> >
> > TheMailMessage.To = txtToEmail.Text
> >
> > TheMailMessage.Subject = txtSubject.Text
> >
> > TheMailMessage.Body = txtMessage.Text
> >
> > TheMailConnection.Send(TheMailMessage)
> >
> > End Sub
> >
> > What I need is to send the mail automatically when the program facing
> > error. How shd I do? Can someone help?
> >
> > Thanks in advanced.
> >
> > rgds, Phoebe.
> >
> >
> >
>
Phoebe. Guest
-
Steve C. Orr, MCSD #3
Re: Sending mail.
There are lots of places you could store that information, but I can't tell
you which is best since I don't know the details of your app.
Off the top of my head I'd think some likely places would be Session,
Application, Cache, a database, a text or xml file, etc.
--
I hope this helps,
Steve C. Orr, MCSD
[url]http://Steve.Orr.net[/url]
"Phoebe." <phoebe8124@hotmail.com> wrote in message
news:eDVzm7bUDHA.212@TK2MSFTNGP12.phx.gbl...failed> Thanks Steve.
>
> My main concern is to send out mail without hardcode those emailTo,
> emailFrom address. Can i save these email address in a file, maybe like
> notepad or something else.
>
> Thanks in advanced.
>
> rgds,
> Phoebe.
>
> "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
> news:OkBc0vbUDHA.1280@tk2msftngp13.phx.gbl...> > One approach would be to put your email code in the Application_OnError
> > event.
> > Here's more info:
> > [url]http://www.ragingsmurf.com/code.aspx?key=K62OO6HIDR[/url]
> > [url]http://www.15seconds.com/issue/030102.htm[/url]
> >
> > --
> > I hope this helps,
> > Steve C. Orr, MCSD
> > [url]http://Steve.Orr.net[/url]
> >
> >
> > "Phoebe." <phoebe8124@hotmail.com> wrote in message
> > news:%23%23Ko9UbUDHA.1680@tk2msftngp13.phx.gbl...> > > Hi, Good Day!
> > >
> > > I am writing a code in order to send a mail out when certain job> hardcoding> > > while running the program. Meanwhile for my testing, I'm either>> > expected> > > the address or type in on the spot so that the mail will be send as> >> > > to certain people. The code is as below.
> > > Sub SubmitBtn_Click(ByVal sender As Object, ByVal e As EventArgs)
> > >
> > > Dim TheMailMessage As New Mail.MailMessage()
> > >
> > > Dim TheMailConnection As SmtpMail
> > >
> > > TheMailMessage.From = txtFromEmail.Text
> > >
> > > TheMailMessage.To = txtToEmail.Text
> > >
> > > TheMailMessage.Subject = txtSubject.Text
> > >
> > > TheMailMessage.Body = txtMessage.Text
> > >
> > > TheMailConnection.Send(TheMailMessage)
> > >
> > > End Sub
> > >
> > > What I need is to send the mail automatically when the program facing
> > > error. How shd I do? Can someone help?
> > >
> > > Thanks in advanced.
> > >
> > > rgds, Phoebe.
> > >
> > >
> > >
> >
>
Steve C. Orr, MCSD Guest
-
Rajeev Soni #4
Re: Sending mail.
Keep your Email Id's in Web.Config file.
define keys for each EmailTO, email from......
you have amny options after that, either read the email-id's when ever u require to send mails or on the application start event read the Email-Ids/Setting from the Web.Config file and load it into Application object/Cahce object but not session... as session is user specific.
hope it helps
Rajeev
"Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message news:eErLPiiUDHA.1052@TK2MSFTNGP09.phx.gbl...> There are lots of places you could store that information, but I can't tell
> you which is best since I don't know the details of your app.
> Off the top of my head I'd think some likely places would be Session,
> Application, Cache, a database, a text or xml file, etc.
>
> --
> I hope this helps,
> Steve C. Orr, MCSD
> [url]http://Steve.Orr.net[/url]
>
>
> "Phoebe." <phoebe8124@hotmail.com> wrote in message
> news:eDVzm7bUDHA.212@TK2MSFTNGP12.phx.gbl...> failed> > Thanks Steve.
> >
> > My main concern is to send out mail without hardcode those emailTo,
> > emailFrom address. Can i save these email address in a file, maybe like
> > notepad or something else.
> >
> > Thanks in advanced.
> >
> > rgds,
> > Phoebe.
> >
> > "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
> > news:OkBc0vbUDHA.1280@tk2msftngp13.phx.gbl...> > > One approach would be to put your email code in the Application_OnError
> > > event.
> > > Here's more info:
> > > [url]http://www.ragingsmurf.com/code.aspx?key=K62OO6HIDR[/url]
> > > [url]http://www.15seconds.com/issue/030102.htm[/url]
> > >
> > > --
> > > I hope this helps,
> > > Steve C. Orr, MCSD
> > > [url]http://Steve.Orr.net[/url]
> > >
> > >
> > > "Phoebe." <phoebe8124@hotmail.com> wrote in message
> > > news:%23%23Ko9UbUDHA.1680@tk2msftngp13.phx.gbl...
> > > > Hi, Good Day!
> > > >
> > > > I am writing a code in order to send a mail out when certain job>> > hardcoding> > > > while running the program. Meanwhile for my testing, I'm either> >> > > > the address or type in on the spot so that the mail will be send as
> > > expected
> > > > to certain people. The code is as below.
> > > > Sub SubmitBtn_Click(ByVal sender As Object, ByVal e As EventArgs)
> > > >
> > > > Dim TheMailMessage As New Mail.MailMessage()
> > > >
> > > > Dim TheMailConnection As SmtpMail
> > > >
> > > > TheMailMessage.From = txtFromEmail.Text
> > > >
> > > > TheMailMessage.To = txtToEmail.Text
> > > >
> > > > TheMailMessage.Subject = txtSubject.Text
> > > >
> > > > TheMailMessage.Body = txtMessage.Text
> > > >
> > > > TheMailConnection.Send(TheMailMessage)
> > > >
> > > > End Sub
> > > >
> > > > What I need is to send the mail automatically when the program facing
> > > > error. How shd I do? Can someone help?
> > > >
> > > > Thanks in advanced.
> > > >
> > > > rgds, Phoebe.
> > > >
> > > >
> > > >
> > >
> > >
> >
>Rajeev Soni Guest



Reply With Quote

