vnarod Posted July 8, 2003 Posted July 8, 2003 I am trying to make my program to send an e-mail. I am getting the error "Could not access CDO.Message object". I am not familiar with CDO. Do I need to add some reference? What should I do? Dim oMail As New System.Web.Mail.MailMessage With oMail .From = "Management_reporting@ubs.com" .To = "first.last@ubs.com" .Subject = sFile Dim myAttachment As System.Web.Mail.MailAttachment = New System.Web.Mail.MailAttachment(sFile) .Attachments.Add(myAttachment) End With System.Web.Mail.SmtpMail.SmtpServer = "NNYCC001PEX1" System.Web.Mail.SmtpMail.Send(oMail) Quote
Leaders dynamic_sysop Posted July 8, 2003 Leaders Posted July 8, 2003 are you sure the System.Web is referenced correctly? and the smtp addy is correct? i just sent an e-mail to my addy with an attatchment without problem like this : Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim wm As New Mail.MailMessage() Dim wa As New Mail.MailAttachment("C:\test.txt") With wm .Subject = "my subject" .To = "dynamic_sysop@msn.com" .From = "me" .Attachments.Add(wa) .BodyFormat = Web.Mail.MailFormat.Text .Body = "some text" End With Dim ws As Mail.SmtpMail ws.SmtpServer = "mail.hotmail.com" ws.Send(wm) End Sub Quote
vnarod Posted July 8, 2003 Author Posted July 8, 2003 I copied your code and still got the same message. I have system.web referenced. SMTP Server name I copy from Outlook(Microsoft Exchange Server property = NNYCC001PEX1). What else I could do? Quote
*Experts* mutant Posted July 8, 2003 *Experts* Posted July 8, 2003 That error usually pops up when the SMTP server is not ready or running, or the application cant connect to it. Check if the Exchange server is up and running. Quote
vnarod Posted July 8, 2003 Author Posted July 8, 2003 What should I check for? The Outlook is running. I thought that was an indication that SMTP server is fine. If I am wrong, please, tell me what I should do. Are SMTP server and Microsoft Exchange Server same thing? I am using Microsoft Exchange Server name from Outlook. Quote
*Experts* Volte Posted July 8, 2003 *Experts* Posted July 8, 2003 No, they are not the same. In order to use the CDO from .NET, you must have access to an SMTP Server; if you are using an NT-generation Operating System like Windows NT, 2K or XP, I believe there is an SMTP server installed with Internet Information Server. If you have installed it, you should be able to configure it from your IIS settings (Control Panel -> Administrative Tools -> Internet Information Services). Quote
vnarod Posted July 8, 2003 Author Posted July 8, 2003 Did I understand you correctly that if a client does not have IIS installed he will not be able to send an e-mail from VB.NET program, even though he has Outlook? Quote
*Experts* Volte Posted July 8, 2003 *Experts* Posted July 8, 2003 (edited) That's not necessarily true; he just needs access to an SMTP server. In theory, you can use any SMTP server that he has access to (usually on a LAN or with an ISP), but if you wish to send mail directly through the client's computer, it will need some form of SMTP server installed on it. Even Outlook requires you to type in server info in order for it to be able to work... I may be way off base here, but that's how I think it is. Edited July 8, 2003 by Volte Quote
TheWizardofInt Posted July 30, 2003 Posted July 30, 2003 "That's not necessarily true; he just needs access to an SMTP server. In theory, you can use any SMTP server that he has access to (usually on a LAN or with an ISP), but if you wish to send mail directly through the client's computer, it will need some form of SMTP server installed on it." Do you know of a method to detect the SMTP or to access it? Specifically, I know my SMTP is through TWC and I have its address. Quote Read the Fovean Chronicles Because you just can't spend your whole day programming!
Diablicolic Posted August 2, 2003 Posted August 2, 2003 I have a big problem with that too, where do you get these servers? I have XP and I can't find what you're talking about (IIS). HELP MAE! IN THE WIN'! BBLLLAAHH!!! Over and out... Quote "Reality is fake, Dreams are for real"
Leaders dynamic_sysop Posted August 2, 2003 Leaders Posted August 2, 2003 to be able to use IIS with XP , you must be running XP Professional. Then go to Add / Remove programmes ... Add / Remove Windows Components , then choose IIS. IIS wont work on XP Home edition. Quote
Diablicolic Posted August 4, 2003 Posted August 4, 2003 (edited) That's crack! Then how do I send e-mails using VB.NET? ---------------------- AAHHH!!!! IT WORKS THANKS YOU!! I HAVE HOME BTW LOL.... BUT JUST DOWNLOAD MSDE I THINK...AND THEN MY CODE IS: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim wm As New System.Web.Mail.MailMessage() With wm .Subject = "my subject" .To = "Diablicolic@msn.com" .From = "me" .BodyFormat = Web.Mail.MailFormat.Text .Body = "some text" End With Dim ws As System.Web.Mail.SmtpMail ws.SmtpServer = "mail.hotmail.com" ws.Send(wm) End Sub Edited August 4, 2003 by Diablicolic Quote "Reality is fake, Dreams are for real"
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.