Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 30th, 2006, 02:38 PM
Authorized User
 
Join Date: Jun 2003
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default email without SmtpMail.Send method???

Hi;

In my code the method SmtpMail.SmtpServer indicates the message "System.Web.HttpException: Could not access 'CDO.Message' object."

I used "localhost" or "127.0.0.1" to set the SmtpMail.SmtpServer but it doesn’t function.

I would like to know if there is another way to send a email in a windows application without the SmtpMail.SmtpServer and SmtpMail.Send methods.

Thanks...
 
Old March 30th, 2006, 03:25 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey, I had the same problem some time ago. I think there is a thread in this forum somewhere, anyways... I know it sounds weird but I solved the problem my setting the server property to the empty string!

Let me know if it helps, Jacob.
 
Old March 31st, 2006, 01:07 PM
Authorized User
 
Join Date: Jun 2003
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for your reply but dont make success...

take a look in my code below:

MailMessage aMensagem = new MailMessage();
aMensagem.From = emailRemetente;
aMensagem.To = this.getEmailInteressado ();
aMensagem.Cc = emailRemetente;
//aMensagem.Bcc = this.txtCopiaOculta.Text;
aMensagem.Subject = "Invoice de Material";
aMensagem.Body = this.rtfTextGeral.Text;

//SmtpMail.SmtpServer = "127.0.0.1";
//SmtpMail.SmtpServer = "128.128.1.1";
//SmtpMail.SmtpServer.Insert (0, "127.0.0.1");
string smtpAux = "";
SmtpMail.SmtpServer = smtpAux;
SmtpMail.Send (aMensagem);
 
Old April 1st, 2006, 10:41 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yep, your code looks cool according to the problem I had, but your problem seems to be different if the code you posted didn't work. The error message you keep getting is caused by many different thinks.

Sorry I couldn't help more. BTW... If your are trying to send emails from your developer machine you might not have an SMTP server running? Then try uploading the page to a web hotel with an SMTP server.

Jacob.





Similar Threads
Thread Thread Starter Forum Replies Last Post
About SmtpMail.Send() Method hhkris4u ASP.NET 1.0 and 1.1 Professional 3 February 6th, 2007 04:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.