kalpa vachhani

kalpa vachhani

  • NA
  • 34
  • 49.5k

cdo.message object

Mar 8 2011 11:05 PM
can you give me example in C# working properly I have it but in vb.net and it is giving error

 Dim myMail As CDO.Message
 
 
myMail.Subject="Sending email with CDO"
  myMail.From = "kalpavachhani.com"
  myMail.To = "[email protected]"
myMail.TextBody="This is a message."
  myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
  myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
  myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
  myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
  myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
 
  ' If your server requires outgoing authentication uncomment the lines bleow and use a valid email address and password.
  myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
  myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "[email protected]"
  myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "*******"
 
  myMail.Configuration.Fields.Update()
myMail.Configuration.Fields.Update
myMail.Send

Answers (3)