473,657 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.BodyFo rmat = MailFormat.Text ;
mmNotify.Subjec t = [my subject];
mmNotify.Body = [my body text];

SmtpMail.SmtpSe rver = "localhost" ;

SmtpMail.Send(m mNotify);

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 2013
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.goo gle.com...
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.BodyFo rmat = MailFormat.Text ;
mmNotify.Subjec t = [my subject];
mmNotify.Body = [my body text];

SmtpMail.SmtpSe rver = "localhost" ;

SmtpMail.Send(m mNotify);

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.Configurati on()

Dim Flds As ADODB.Fields

Flds = iConf.Fields

With Flds
'.Item(cdoSMTPC onnectionTimeou t).Value = 20 '
quick timeout
'.Item(cdoURLPr oxyServer).Valu e = "<local>"
'.Item(cdoURLGe tLatestVersion) .Value = True

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

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

With iMsg
.Configuration = iConf
.To = ToList '"aq****@domini o.com"
.From = sFrom '"paraq****@dom inio.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.goo gle.com...
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.BodyFo rmat = MailFormat.Text ;
mmNotify.Subjec t = [my subject];
mmNotify.Body = [my body text];

SmtpMail.SmtpSe rver = "localhost" ;

SmtpMail.Send(m mNotify);

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.SmtpSe rver code, that worked for me !!!

Kind regards,
Jurjen de Groot
Netherlands.

"JJBW" <ja***********@ hotmail.com> wrote in message
news:ae******** *************** ***@posting.goo gle.com...
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.BodyFo rmat = MailFormat.Text ;
mmNotify.Subjec t = [my subject];
mmNotify.Body = [my body text];

SmtpMail.SmtpSe rver = "localhost" ;

SmtpMail.Send(m mNotify);

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
1465
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 got it to send messages for me which is great.... Unfortunately, I do not receive the complete contents of the Body. I have ran a few tests to see what the Body contained before and after the SmtpMail.Send() call and they matched. Something down...
8
379
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 integrated window authentication. it does work, and works fine on my dev machine. it also works fine on the test server, but with some considerations. on the test server, i can send emails IF they do not include any attachments. as soon as i send an email...
2
2540
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; // hard-coded mail.To = platypus@somewhere.com; mail.Subject = "Test"; mail.Body = strMessage;
5
2141
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
2694
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 e-mail addresses out side my company walls. When the e-mail is send on some one in my company it works perfect. I think it is a relay issue. Our system administrator will not allow relaying. In the ASP.Net web.config file I let the web application...
3
9251
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 e-mail addresses out side my company walls. When the e-mail is send on some one in my company it works perfect. I think it is a relay issue. Our system administrator will not allow relaying. In the ASP.Net web.config file I let the web application...
17
3776
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
1850
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 which he can then open with Acrobat. All my pdf files work fine via a browser, but some are corrupted by one byte when sent as an email attachment. The problem is 100% reproducible - the code is trivial. Am I missing something obvious or is this a...
19
3361
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 msg.Attachments.Add(New MailAttachment(attachFile)) msg.Subject = subjectString
0
8837
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
8739
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...
1
8512
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8612
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...
1
6175
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5638
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
4171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2739
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

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.