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

SmtpMail problem

Hi

I am having a bit of a problem with SmtpMail. I have a bit of code
that should send an email but when it is executed no email turns up.

MailMessage mmNotify = new MailMessage();

mmNotify.From = [from email address];
mmNotify.To = [recipient email address];
mmNotify.BodyFormat = MailFormat.Text;
mmNotify.Subject = [my subject];
mmNotify.Body = [my body text];

SmtpMail.SmtpServer = "localhost";

SmtpMail.Send(mmNotify);

If I stop my SmtpServer (which runs on my box) I get the following
error message:

Cannot access CDO.Message object

If I then start the SmtpServer the message does not arise.

I assume that this means the MailMessage object get created.

When the send method is called an exception is not created and the
code continues to execute.

What happens to my email ? Where does it go ? It doesn't even end up
in the DROP, BADMAIL etc folders
Any suggestions ????
Nov 18 '05 #1
3 1989
Sounds to me to be a problem with your mail server than with your code
(Which looks fine to me). Have you tried setting the mail server to
something different than your local box and see what happens?

"JJBW" <ja***********@hotmail.com> wrote in message
news:ae**************************@posting.google.c om...
Hi

I am having a bit of a problem with SmtpMail. I have a bit of code
that should send an email but when it is executed no email turns up.

MailMessage mmNotify = new MailMessage();

mmNotify.From = [from email address];
mmNotify.To = [recipient email address];
mmNotify.BodyFormat = MailFormat.Text;
mmNotify.Subject = [my subject];
mmNotify.Body = [my body text];

SmtpMail.SmtpServer = "localhost";

SmtpMail.Send(mmNotify);

If I stop my SmtpServer (which runs on my box) I get the following
error message:

Cannot access CDO.Message object

If I then start the SmtpServer the message does not arise.

I assume that this means the MailMessage object get created.

When the send method is called an exception is not created and the
code continues to execute.

What happens to my email ? Where does it go ? It doesn't even end up
in the DROP, BADMAIL etc folders
Any suggestions ????

Nov 18 '05 #2

Hi, JJBW !
It could be a relay o authentication issue !
Try this using CDO..
*****
Dim iMsg As New CDO.Message()
Dim iConf As New CDO.Configuration()

Dim Flds As ADODB.Fields

Flds = iConf.Fields

With Flds
'.Item(cdoSMTPConnectionTimeout).Value = 20 '
quick timeout
'.Item(cdoURLProxyServer).Value = "<local>"
'.Item(cdoURLGetLatestVersion).Value = True

.Item
("http://schemas.microsoft.com/cdo/configuration/sendusing"
).Value = 2
.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserver
").Value = SMTPServer
.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserver
port").Value = 25

.Item
("http://schemas.microsoft.com/cdo/configuration/smtpauthen
ticate").Value = 1
.Item
("http://schemas.microsoft.com/cdo/configuration/senduserna
me").Value = "usuario"
.Item
("http://schemas.microsoft.com/cdo/configuration/sendpasswo
rd").Value = "password"
.Update()
End With

With iMsg
.Configuration = iConf
.To = ToList '"aq****@dominio.com"
.From = sFrom '"paraq****@dominio.com"
.Subject = Subject '"A Subject Line"
.TextBody = sBody '"A Text body message"

.Fields.Update()
.Send()
End With

I Hope this help..

ONil@.
MX.
"JJBW" <ja***********@hotmail.com> wrote in message
news:ae**************************@posting.google.c om...
Hi

I am having a bit of a problem with SmtpMail. I have a bit of code
that should send an email but when it is executed no email turns up.

MailMessage mmNotify = new MailMessage();

mmNotify.From = [from email address];
mmNotify.To = [recipient email address];
mmNotify.BodyFormat = MailFormat.Text;
mmNotify.Subject = [my subject];
mmNotify.Body = [my body text];

SmtpMail.SmtpServer = "localhost";

SmtpMail.Send(mmNotify);

If I stop my SmtpServer (which runs on my box) I get the following
error message:

Cannot access CDO.Message object

If I then start the SmtpServer the message does not arise.

I assume that this means the MailMessage object get created.

When the send method is called an exception is not created and the
code continues to execute.

What happens to my email ? Where does it go ? It doesn't even end up
in the DROP, BADMAIL etc folders
Any suggestions ????

Nov 18 '05 #3
Try commenting the smtpMail.SmtpServer code, that worked for me !!!

Kind regards,
Jurjen de Groot
Netherlands.

"JJBW" <ja***********@hotmail.com> wrote in message
news:ae**************************@posting.google.c om...
Hi

I am having a bit of a problem with SmtpMail. I have a bit of code
that should send an email but when it is executed no email turns up.

MailMessage mmNotify = new MailMessage();

mmNotify.From = [from email address];
mmNotify.To = [recipient email address];
mmNotify.BodyFormat = MailFormat.Text;
mmNotify.Subject = [my subject];
mmNotify.Body = [my body text];

SmtpMail.SmtpServer = "localhost";

SmtpMail.Send(mmNotify);

If I stop my SmtpServer (which runs on my box) I get the following
error message:

Cannot access CDO.Message object

If I then start the SmtpServer the message does not arise.

I assume that this means the MailMessage object get created.

When the send method is called an exception is not created and the
code continues to execute.

What happens to my email ? Where does it go ? It doesn't even end up
in the DROP, BADMAIL etc folders
Any suggestions ????

Nov 18 '05 #4

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

Similar topics

3
by: Edwin G. Castro | last post by:
I'm using the System.Web.Mail.SmtpMail class to send email from an app I wrote. I needed to install IIS to get it to send the messages even though I wanted to use an existing SMTP server. Anyway, I...
8
by: Jason | last post by:
Hi not sure if this is the write place, but i really need some help with this...! I have a piece of code that sends email using the SmtpMail class, in an ASP.NET web application, with...
2
by: Leszek | last post by:
Hello, I have created a simple code to send emails using the MailMessage class and the SmtpMail.Send() method: MailMessage mail = new MailMessage(); mail.From = echidna@somewhere.com; //...
5
by: ElanKathir | last post by:
Hi ! I wrote one code for Send the E-mail, But that code have some problem , So please help me Here i paste my code and Error: Error: Server Error in '/Elan_Sample' Application. ...
1
by: Jens Øster | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
3
by: Jens | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
17
by: LACH | last post by:
When I sent e-mail from within my asp.net application to Hotmail adresses. The e-mail always end up in Junk e-mail. I sent the e-mail as plain/text. Does anyone know how to solve this?
9
by: Russell Stevens | last post by:
I generate pdf files on my server and allow users to access them via a browser and also email them. Most files work fine whether the user uses his browser or gets an email with a pdf attachment...
19
by: zdrakec | last post by:
Hello all: Using an "Imports System.Web.Mail" clause at the head of my module, and after executing the following code: Dim msg As New MailMessage msg.From = sender msg.To = recipient...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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,...

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.