By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,612 Members | 1,632 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,612 IT Pros & Developers. It's quick & easy.

Send E-Mail from VB.Net 2003

P: n/a
I am trying to send an e-mail using one of the examples I got on this group
as follows: (both toemail and myemail are valid e-mail addreses.

'System.Web.Mail' (requires reference to "System.Web.dll"),
''' delcare a new mail message
Dim aMailMessage As New System.Web.Mail.MailMessage

''' set the from address
aMailMessage.From = myemail
''' set the to address and subject
aMailMessage.To = toemail
aMailMessage.Subject = "Test Sending E-Mail from VB."

''' send in Text format
aMailMessage.BodyFormat = System.Web.Mail.MailFormat.Text

''' set the body text
aMailMessage.Body = "This is the text of the email message from
my test Program."

''' add an attachment if you want to
'aMailMessage.Attachments.Add(New
System.Web.Mail.MailAttachment("C:Test.txt",
System.Web.Mail.MailEncoding.Base64))

''' send the email
System.Web.Mail.SmtpMail.SmtpServer = "smtp.sbcglobal.net"
System.Web.Mail.SmtpMail.Send(aMailMessage)

I get an error message stating "Could not access CDO.Message Object. Anyone
know what I'm doing wrong, My e-mail is via RoadRunner Internet connection.
--
Dennis in Houston
Jan 9 '06 #1
Share this Question
Share on Google+
10 Replies


P: n/a

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:6A**********************************@microsof t.com...
I get an error message stating "Could not access CDO.Message Object.
Anyone
know what I'm doing wrong, My e-mail is via RoadRunner Internet
connection.


RoadRunner? Spam Central?

Jan 9 '06 #2

P: n/a
Hi Dennis:

I face the same problem three weeks ago so if your opreating system is
windows XP

do the following:
1\ go to control panel, then go to Administrative Tools , after that go to
something called Internet Information services IIS, if you did not find IIS
that mean you have to install this componant from windows XP CD.

2\ When you Open IIS go to the Local Computer and click plus sign you will
find
something called Default SMTP Virtual Server, right click and go to the
access tab
after that click relay button add IP address this one :"127.0.0.1" and set
System.Web.Mail.SmtpMail.SmtpServer = "127.0.0.1" and your problem will be
solved God willing, If you want more infromation about this error message
which is familire go to

http://www.systemwebmail.net/faq/4.2.3.aspx

Husam
"Dennis" wrote:
I am trying to send an e-mail using one of the examples I got on this group
as follows: (both toemail and myemail are valid e-mail addreses.

'System.Web.Mail' (requires reference to "System.Web.dll"),
''' delcare a new mail message
Dim aMailMessage As New System.Web.Mail.MailMessage

''' set the from address
aMailMessage.From = myemail
''' set the to address and subject
aMailMessage.To = toemail
aMailMessage.Subject = "Test Sending E-Mail from VB."

''' send in Text format
aMailMessage.BodyFormat = System.Web.Mail.MailFormat.Text

''' set the body text
aMailMessage.Body = "This is the text of the email message from
my test Program."

''' add an attachment if you want to
'aMailMessage.Attachments.Add(New
System.Web.Mail.MailAttachment("C:Test.txt",
System.Web.Mail.MailEncoding.Base64))

''' send the email
System.Web.Mail.SmtpMail.SmtpServer = "smtp.sbcglobal.net"
System.Web.Mail.SmtpMail.Send(aMailMessage)

I get an error message stating "Could not access CDO.Message Object. Anyone
know what I'm doing wrong, My e-mail is via RoadRunner Internet connection.
--
Dennis in Houston

Jan 9 '06 #3

P: n/a
hi,
i had this problem when i was learning mailing through vs2003.
right now i dont remember what i had done but i think i've updated my
OS with latest Service Pack available at Microsoft site and it started
working. also check that you have latest version of IIS with latest
Service Pack on your pc. coz it might also require for your programm.

Lucky

Jan 9 '06 #4

P: n/a
hi,
i had this problem when i was learning mailing through vs2003.
right now i dont remember what i had done but i think i've updated my
OS with latest Service Pack available at Microsoft site and it started
working. also check that you have latest version on IIS on your pc. coz
it might also require for your programm.

Jan 9 '06 #5

P: n/a
hi,
i had this problem when i was learning mailing through vs2003.
right now i dont remember what i had done but i think i've updated my
OS with latest Service Pack available at Microsoft site and it started
working. also check that you have latest version of IIS with latest
Service Pack on your pc. coz it might also require for your programm.

Lucky

Jan 9 '06 #6

P: n/a
Not everyone has IIs installed. I want to send e-mail from my application
when the user clicks a button "Contact Us"' and the user may not have IIS
installed.

Isn't there a way to find the user's e-mail server and use that name?

--
Dennis in Houston
"Husam" wrote:
Hi Dennis:

I face the same problem three weeks ago so if your opreating system is
windows XP

do the following:
1\ go to control panel, then go to Administrative Tools , after that go to
something called Internet Information services IIS, if you did not find IIS
that mean you have to install this componant from windows XP CD.

2\ When you Open IIS go to the Local Computer and click plus sign you will
find
something called Default SMTP Virtual Server, right click and go to the
access tab
after that click relay button add IP address this one :"127.0.0.1" and set
System.Web.Mail.SmtpMail.SmtpServer = "127.0.0.1" and your problem will be
solved God willing, If you want more infromation about this error message
which is familire go to

http://www.systemwebmail.net/faq/4.2.3.aspx

Husam
"Dennis" wrote:
I am trying to send an e-mail using one of the examples I got on this group
as follows: (both toemail and myemail are valid e-mail addreses.

'System.Web.Mail' (requires reference to "System.Web.dll"),
''' delcare a new mail message
Dim aMailMessage As New System.Web.Mail.MailMessage

''' set the from address
aMailMessage.From = myemail
''' set the to address and subject
aMailMessage.To = toemail
aMailMessage.Subject = "Test Sending E-Mail from VB."

''' send in Text format
aMailMessage.BodyFormat = System.Web.Mail.MailFormat.Text

''' set the body text
aMailMessage.Body = "This is the text of the email message from
my test Program."

''' add an attachment if you want to
'aMailMessage.Attachments.Add(New
System.Web.Mail.MailAttachment("C:Test.txt",
System.Web.Mail.MailEncoding.Base64))

''' send the email
System.Web.Mail.SmtpMail.SmtpServer = "smtp.sbcglobal.net"
System.Web.Mail.SmtpMail.Send(aMailMessage)

I get an error message stating "Could not access CDO.Message Object. Anyone
know what I'm doing wrong, My e-mail is via RoadRunner Internet connection.
--
Dennis in Houston

Jan 10 '06 #7

P: n/a
check out this link, this might help u

http://www.systemwebmail.net/

Jan 10 '06 #8

P: n/a
Maybe you need authetication on your smtp server for example:
//using System.Web.Mail;
eMail = new MailMessage();
eMail.BodyFormat = MailFormat.Text;
eMail.From = _SendFrom;

eMail.Fields[http://schemas.microsoft.com/cdo/con...on/smtsperver]
= "SMTPServerName";

eMail.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserverport"]
= 25;

eMail.Fields["http://schemas.microsoft.com/cdo/configuration/sendusing"]
= 2;
if (SMTPUser != null && SMTPPassword != null)
{

eMail.Fields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"]
= 1;

eMail.Fields["http://schemas.microsoft.com/cdo/configuration/sendusername"]
= "SMTPAUTHUser";

eMail.Fields["http://schemas.microsoft.com/cdo/configuration/sendpassword"]
= "SMTPAUTHPassword";
}
eMail.To = "recipients";
SmtpMail.SmtpServer = SMTPServerName;
SmtpMail.Send(eMail);
//
see this link:
http://msdn.microsoft.com/library/de...figuration.asp

Jan 10 '06 #9

P: n/a
I have heard that some SMTP servers won't let you send Email without a POP
transaction first. I think that is standard security in many servers to
prevent unauthorised people and spammers from using their servers. It is not
just SMTP authorisation which can solve your problem. My Email server does
this too.

So try logging into your POP mail before you try to send the mail through
SMTP. I think things will work for you.

Regards
Cyril
Jan 11 '06 #10

P: n/a
Yes, there are 2 basic methods:

- SMTP authentication: you pass the user/password
- POP before SMTP: you need to pop messages first (to prove that you own the
account) and they you have a time window (30 minutes or so) to send
messages.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio 2005, Visual Studio .NET,
VB6, VB5 and VBA
You can code, design and document much faster in VB.NET, C#, C++ or VJ#
Free resources for add-in developers:
http://www.mztools.com
"Cyril Gupta" <no****@mail.com> escribió en el mensaje
news:uf**************@TK2MSFTNGP10.phx.gbl...
I have heard that some SMTP servers won't let you send Email without a POP
transaction first. I think that is standard security in many servers to
prevent unauthorised people and spammers from using their servers. It is
not just SMTP authorisation which can solve your problem. My Email server
does this too.

So try logging into your POP mail before you try to send the mail through
SMTP. I think things will work for you.

Regards
Cyril

Jan 11 '06 #11

This discussion thread is closed

Replies have been disabled for this discussion.