-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: vineetbatta
Message 2 in Discussion

   
I can give you a solution in C# and you can convert it into VB.NET or VB with little 
effort. 
Give refrence to CDOSYS.dll OR CDOEX.dll 
CDO.ConfigurationClass Config = new CDO.ConfigurationClass(); 
ADODB.Fields ADOfields = Config.Fields; 
ADOfields["http://schemas.microsoft.com/cdo/configuration/smtpserver"].Value = 
"[Server Name]"; 
ADOfields["http://schemas.microsoft.com/cdo/configuration/smtpserverport"].Value = 25; 
ADOfields["http://schemas.microsoft.com/cdo/configuration/sendusing"].Value = 
CDO.CdoSendUsing.cdoSendUsingPort; 
ADOfields.Update(); 
ADODB.Fields fields; 
 
CDO.MessageClass mMail = new CDO.MessageClass(); 
CDO.IBodyPart Parentpart = mMail.BodyPart ; 
CDO.IBodyPart childPart; 
ADODB.Stream contentStream = null; // Stream 
mMail.Charset = "us-ascii"; 
fields = Parentpart .Fields; 
fields["urn:schemas:httpmail:from"].Value = [Address]; 
fields["urn:schemas:httpmail:to"].Value = "[Address]"; 
fields["urn:schemas:httpmail:subject"].Value = "Test Subject"; 
fields["urn:schemas:mailheader:content-type"].Value = "multipart/mixed"; 
fields.Update(); 
 
// Text Bodypart - Add the body part for the text/plain part of message 
childPart= Parentpart.AddBodyPart(-1); 
fields = childBodyPart.Fields; 
fields["urn:schemas:mailheader:content-type"].Value = "text/plain"; 
fields.Update(); 
childPart.Charset = "us-ascii"; 
// Get the stream and add the message 
cStream = childPart.GetDecodedContentStream(); 
cStream.WriteText("Hello India", ADODB.StreamWriteEnum.adWriteChar); 
cStream.Flush(); 
cStream.Close(); 
 
childPart.Charset = "us-ascii"; 
//msgMail.TextBody = "Hello India"; 
CDO.IBodyPart Attachment = null; 
Attachment = mMail.AddAttachment(@"E:\Hello.bmp","",""); 
 
 
 
msgMail.Configuration = cdoConfig;  
 
cdoConfig = null; 
msgMail.Send(); 
Do let me know incase of any issues. 
Vineet Batta 
MCAD

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to