473,324 Members | 2,356 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,324 software developers and data experts.

How to determine if e-mail was sent OK

With system.web.mail in VS2003, doing some tests, using localhost from IIS
as server, I noticed that my code queues the messages OK, but when changing
sender addresses I see that the mail message ends up in the Bad folder. I
need to know when that happens since the e-mails are of critical importance.
How can I detect in my code, if an e-mail got queued but the actual
transmission from the server was unsuccessfull and how can I find what the
reason for the failure was?

Any help would be appreciated,

Bob
Dec 22 '06 #1
5 1558
authenticate and avoid the problem entirely....1.1 and above

Private Sub Page_Load(sender As Object, e As System.EventArgs)
Dim mail As New MailMessage()
mail.To = "me@mycompany.com"
mail.From = "yo*@yourcompany.com"
mail.Subject = "this is a test email."
mail.Body = "Some text goes here"
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
"1") 'basic authentication
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
"my_username_here") 'set your username here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
"super_secret") 'set your password here
SmtpMail.SmtpServer = "mail.mycompany.com" 'your real server goes here
SmtpMail.Send(mail)
End Sub 'Page_Load

"Robert Dufour" <bd*****@sgiims.comwrote in message
news:eU**************@TK2MSFTNGP03.phx.gbl...
With system.web.mail in VS2003, doing some tests, using localhost from IIS
as server, I noticed that my code queues the messages OK, but when
changing sender addresses I see that the mail message ends up in the Bad
folder. I need to know when that happens since the e-mails are of critical
importance. How can I detect in my code, if an e-mail got queued but the
actual transmission from the server was unsuccessfull and how can I find
what the reason for the failure was?

Any help would be appreciated,

Bob


Dec 22 '06 #2
Thanks for code but I don't understand what Username and Password the code
refers to? Can you help me to understand.
--
Dennis in Houston
"vbnetdev" wrote:
authenticate and avoid the problem entirely....1.1 and above

Private Sub Page_Load(sender As Object, e As System.EventArgs)
Dim mail As New MailMessage()
mail.To = "me@mycompany.com"
mail.From = "yo*@yourcompany.com"
mail.Subject = "this is a test email."
mail.Body = "Some text goes here"
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
"1") 'basic authentication
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
"my_username_here") 'set your username here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
"super_secret") 'set your password here
SmtpMail.SmtpServer = "mail.mycompany.com" 'your real server goes here
SmtpMail.Send(mail)
End Sub 'Page_Load

"Robert Dufour" <bd*****@sgiims.comwrote in message
news:eU**************@TK2MSFTNGP03.phx.gbl...
With system.web.mail in VS2003, doing some tests, using localhost from IIS
as server, I noticed that my code queues the messages OK, but when
changing sender addresses I see that the mail message ends up in the Bad
folder. I need to know when that happens since the e-mails are of critical
importance. How can I detect in my code, if an e-mail got queued but the
actual transmission from the server was unsuccessfull and how can I find
what the reason for the failure was?

Any help would be appreciated,

Bob


Dec 23 '06 #3
The username and password used to access the email account for that mail
server.

"Dennis" <De****@discussions.microsoft.comwrote in message
news:F3**********************************@microsof t.com...
Thanks for code but I don't understand what Username and Password the
code
refers to? Can you help me to understand.
--
Dennis in Houston
"vbnetdev" wrote:
>authenticate and avoid the problem entirely....1.1 and above

Private Sub Page_Load(sender As Object, e As System.EventArgs)
Dim mail As New MailMessage()
mail.To = "me@mycompany.com"
mail.From = "yo*@yourcompany.com"
mail.Subject = "this is a test email."
mail.Body = "Some text goes here"

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
"1") 'basic authentication

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
"my_username_here") 'set your username here

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
"super_secret") 'set your password here
SmtpMail.SmtpServer = "mail.mycompany.com" 'your real server goes here
SmtpMail.Send(mail)
End Sub 'Page_Load

"Robert Dufour" <bd*****@sgiims.comwrote in message
news:eU**************@TK2MSFTNGP03.phx.gbl...
With system.web.mail in VS2003, doing some tests, using localhost from
IIS
as server, I noticed that my code queues the messages OK, but when
changing sender addresses I see that the mail message ends up in the
Bad
folder. I need to know when that happens since the e-mails are of
critical
importance. How can I detect in my code, if an e-mail got queued but
the
actual transmission from the server was unsuccessfull and how can I
find
what the reason for the failure was?

Any help would be appreciated,

Bob




Dec 24 '06 #4
cj
I'm interested in your code but don't understand the
"http://schemas...." you have in it. This is what I've been using. Can
you explain the difference? Mine works. Just curious.

Dim msg As New System.Net.Mail.MailMessage
Dim smtp As New System.Net.Mail.SmtpClient
msg.From = New System.Net.Mail.MailAddress("cj@my_co.com")
msg.To.Add("Sally@my_co.com,Bob@his_co.com")
msg.Subject = "This is a test"
msg.Body = "This is only a test" & vbcrlf & "1 2 3"
smtp.Host = "smtp.my_co.com"
smtp.Port = 25
smtp.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
smtp.Credentials = New
System.Net.NetworkCredential("me@my_co.com", "my_pass")
smtp.Send(msg)
vbnetdev wrote:
authenticate and avoid the problem entirely....1.1 and above

Private Sub Page_Load(sender As Object, e As System.EventArgs)
Dim mail As New MailMessage()
mail.To = "me@mycompany.com"
mail.From = "yo*@yourcompany.com"
mail.Subject = "this is a test email."
mail.Body = "Some text goes here"
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
"1") 'basic authentication
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
"my_username_here") 'set your username here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
"super_secret") 'set your password here
SmtpMail.SmtpServer = "mail.mycompany.com" 'your real server goes here
SmtpMail.Send(mail)
End Sub 'Page_Load

"Robert Dufour" <bd*****@sgiims.comwrote in message
news:eU**************@TK2MSFTNGP03.phx.gbl...
>With system.web.mail in VS2003, doing some tests, using localhost from IIS
as server, I noticed that my code queues the messages OK, but when
changing sender addresses I see that the mail message ends up in the Bad
folder. I need to know when that happens since the e-mails are of critical
importance. How can I detect in my code, if an e-mail got queued but the
actual transmission from the server was unsuccessfull and how can I find
what the reason for the failure was?

Any help would be appreciated,

Bob


Dec 27 '06 #5
cj
actually "me@my_co.com" should be "cj@my_co.com" just example names
anyway but the same address is used from msg.from and in the network
credential.

cj wrote:
I'm interested in your code but don't understand the
"http://schemas...." you have in it. This is what I've been using. Can
you explain the difference? Mine works. Just curious.

Dim msg As New System.Net.Mail.MailMessage
Dim smtp As New System.Net.Mail.SmtpClient
msg.From = New System.Net.Mail.MailAddress("cj@my_co.com")
msg.To.Add("Sally@my_co.com,Bob@his_co.com")
msg.Subject = "This is a test"
msg.Body = "This is only a test" & vbcrlf & "1 2 3"
smtp.Host = "smtp.my_co.com"
smtp.Port = 25
smtp.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
smtp.Credentials = New
System.Net.NetworkCredential("me@my_co.com", "my_pass")
smtp.Send(msg)
vbnetdev wrote:
>authenticate and avoid the problem entirely....1.1 and above

Private Sub Page_Load(sender As Object, e As System.EventArgs)
Dim mail As New MailMessage()
mail.To = "me@mycompany.com"
mail.From = "yo*@yourcompany.com"
mail.Subject = "this is a test email."
mail.Body = "Some text goes here"

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
"1") 'basic authentication

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
"my_username_here") 'set your username here

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
"super_secret") 'set your password here
SmtpMail.SmtpServer = "mail.mycompany.com" 'your real server goes here
SmtpMail.Send(mail)
End Sub 'Page_Load

"Robert Dufour" <bd*****@sgiims.comwrote in message
news:eU**************@TK2MSFTNGP03.phx.gbl...
>>With system.web.mail in VS2003, doing some tests, using localhost
from IIS as server, I noticed that my code queues the messages OK,
but when changing sender addresses I see that the mail message ends
up in the Bad folder. I need to know when that happens since the
e-mails are of critical importance. How can I detect in my code, if
an e-mail got queued but the actual transmission from the server was
unsuccessfull and how can I find what the reason for the failure was?

Any help would be appreciated,

Bob


Dec 27 '06 #6

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

Similar topics

2
by: Nathan Sokalski | last post by:
I want to determine the operating system using ASP (or VBScript inside of ASP). I tried to get it using the Request. ServerVariables(EnvironmentVariable) method. On the web page about ASP in which...
3
by: Shahid Juma | last post by:
Hello All, This may be a trivial question, but I was wondering how can you determine if a value contains an Integer or Float. I know there is a function called IsNumeric, however you can't...
5
by: Hennie de Nooijer | last post by:
Hi, This is a diffcult issue to explain. I hope to make my problem clear to you. SITUATION I'm building A SLA Query for a customer. This customer has an awkward way to determine the SLA results...
18
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code...
9
by: Adam | last post by:
Can someone please help!! I am trying to figure out what a font is? Assume I am working with a fixed font say Courier 10 point font Question 1: What does this mean 10 point font Question 2:...
2
by: Ryu | last post by:
Is there a way to determine if a text is ASCII or Unicode in C#. I have looked at Encoding classes but I have found that They dont allow me to pass a text to the encoding obj. In addition is there...
6
by: Arsen V. | last post by:
Hello, I have a localization class that I want to use from either Web or Windows Forms apps. Currently it stores some information in the HttpRuntime.Cache object. I want to be able to determine...
7
by: semedao | last post by:
Hi all, I view many posts about this issue , the connected property does not tell us the current status of the socket. based on couple of suggestions of msdn , and some article here , I try to...
6
by: Jana | last post by:
Greetings Access Gurus! I am working on an app to send batch transactions to our bank, and the bank requires that we place an effective date on our files that is 'one business day in the future,...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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

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.