CDO.Message

  • Thread starter Thread starter Alexander Widera
  • Start date Start date
A

Alexander Widera

Hello,

I'm not able to re-write this code (look below) from vbscript to C#. And I
don't find a manual in the net ... could somebody help me please?

DIM oMessage
oMessage= CreateObject("CDO.Message")
oMessage.From = "(e-mail address removed)"
oMessage.To = "(e-mail address removed)"
oMessage.Subject = "Subject"
oMessage.Textbody = "Content"
oMessage.Send


Thx
Alex
 
Hi Alex,

You can use System.Web.Mail.MailMessage and
System.Web.Mail.SmtpMail to send email:

MailMessage MyMail = new MailMessage();
MyMail.From = sFrom;
MyMail.To = sTo;
MyMail.Subject = sSubject;
MyMail.Body = sBody;
MyMail.Cc = sCc;
MyMail.Bcc = sBcc;
SmtpMail.SmtpServer = sMailServer;
SmtpMail.Send(MyMail);


HTH

Elton Wang
(e-mail address removed)
 
is this the only way?
i have a problem .... if i use vbscript with CDO.Message the sending works
.... but with c# and the method you wrote it doesn't (work). i receive no
mail...

Alex
 
Back
Top