PC Review


Reply
Thread Tools Rate Thread

CDO Messaging

 
 
Marlon
Guest
Posts: n/a
 
      22nd Jul 2003
please anyone, kindly enlighten me...

im using CDO do send email with attachment to a specific
SMTP server in VBScript (*.vbs file). i just used a
sample code i found on the net, here it is:

set objMessage = CreateObject("CDO.Message")
objMessage.Subject = subj
objMessage.Sender = "(E-Mail Removed)"
objMessage.From = "Fax Server"
objMessage.ReplyTo = "(E-Mail Removed)"
objMessage.To = emailadd
objMessage.AddAttachment filename

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing"
) = 2

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver
") = "192.168.0.12"

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver
port") = 25

objMessage.Configuration.Fields.Update

objMessage.Send

i dont have much background about CDO, i just want to know
why the script include lines such
as "("http://schemas.microsoft.com/cdo/configuration/smtpse
rverport")"? does the pc where im running this script
needs a internet access? and any other site i could use
for reference about this object?

thanks!!!
marlon

 
Reply With Quote
 
 
 
 
neo [mvp outlook]
Guest
Posts: n/a
 
      22nd Jul 2003
No. The PC does not need internet access, it just needs LAN/WAN
connectivity. The lines are telling the CDO library that you wish to send
the message via a port request and that it should try and connect on port 25
to 192.168.0.12.

"Marlon" <(E-Mail Removed)> wrote in message
news:04ab01c34fee$882717e0$(E-Mail Removed)...
> please anyone, kindly enlighten me...
>
> im using CDO do send email with attachment to a specific
> SMTP server in VBScript (*.vbs file). i just used a
> sample code i found on the net, here it is:
>
> set objMessage = CreateObject("CDO.Message")
> objMessage.Subject = subj
> objMessage.Sender = "(E-Mail Removed)"
> objMessage.From = "Fax Server"
> objMessage.ReplyTo = "(E-Mail Removed)"
> objMessage.To = emailadd
> objMessage.AddAttachment filename
>
> objMessage.Configuration.Fields.Item _
> ("http://schemas.microsoft.com/cdo/configuration/sendusing"
> ) = 2
>
> objMessage.Configuration.Fields.Item _
> ("http://schemas.microsoft.com/cdo/configuration/smtpserver
> ") = "192.168.0.12"
>
> objMessage.Configuration.Fields.Item _
> ("http://schemas.microsoft.com/cdo/configuration/smtpserver
> port") = 25
>
> objMessage.Configuration.Fields.Update
>
> objMessage.Send
>
> i dont have much background about CDO, i just want to know
> why the script include lines such
> as "("http://schemas.microsoft.com/cdo/configuration/smtpse
> rverport")"? does the pc where im running this script
> needs a internet access? and any other site i could use
> for reference about this object?
>
> thanks!!!
> marlon
>



 
Reply With Quote
 
Ed Astle
Guest
Posts: n/a
 
      22nd Jul 2003
The http://schema.microsoft.com/blah things are just unique keys to access
configuration items. They could have used GUIDS but then they wouldn't mean
much to the programmer.

Alternatively (in vb6) use the type library "Microsoft CDO for Windows 2000
Library". Then you can do:

Dim fields As ADODB.fields

Set m_cdomsg = New CDO.Message
Set m_cdocfg = New CDO.Configuration
Set fields = m_cdocfg.fields
fields(cdoSMTPServer) = sServer
fields(cdoSMTPServerPort) = CLng(sPort)
fields(cdoSMTPAuthenticate) = cdoAnonymous
fields(cdoSendUsingMethod) = cdoSendUsingPort
fields.Update
Set fields = Nothing
Set m_cdomsg.Configuration = m_cdocfg

m_cdomsg.From = Trim(sFrom)
m_cdomsg.Subject = Trim(sSubject)
etc.

In ASP I've used this too:

<% ' GUID for Microsoft CDO for Windows 2000 Library... %>
<!-- METADATA TYPE="TypeLib" UUID="{CD000000-8B95-11D1-82DB-00C04FB1625D}"
VERSION="1.0"-->

Dim cdomsg ' As CDO.Message
Dim cdocfg ' As CDO.Configuration
Dim fields ' As ADODB.fields

Set cdomsg = Server.CreateObject( "CDO.Message" )
Set cdocfg = Server.CreateObject( "CDO.Configuration" )
Set fields = cdocfg.Fields

fields( cdoSMTPServer ) = Application( "sEmailServer" )
fields( cdoSMTPServerPort ) = Application( "nEmailServerPort" )
fields( cdoSMTPAuthenticate ) = cdoAnonymous
fields( cdoSendUsingMethod ) = cdoSendUsingPort
fields.Update
etc.

Both the above snippets used on win2k server.
Regards,
Ed.

"Marlon" <(E-Mail Removed)> wrote in message
news:04ab01c34fee$882717e0$(E-Mail Removed)...
> please anyone, kindly enlighten me...
>
> im using CDO do send email with attachment to a specific
> SMTP server in VBScript (*.vbs file). i just used a
> sample code i found on the net, here it is:
>
> set objMessage = CreateObject("CDO.Message")
> objMessage.Subject = subj
> objMessage.Sender = "(E-Mail Removed)"
> objMessage.From = "Fax Server"
> objMessage.ReplyTo = "(E-Mail Removed)"
> objMessage.To = emailadd
> objMessage.AddAttachment filename
>
> objMessage.Configuration.Fields.Item _
> ("http://schemas.microsoft.com/cdo/configuration/sendusing"
> ) = 2
>
> objMessage.Configuration.Fields.Item _
> ("http://schemas.microsoft.com/cdo/configuration/smtpserver
> ") = "192.168.0.12"
>
> objMessage.Configuration.Fields.Item _
> ("http://schemas.microsoft.com/cdo/configuration/smtpserver
> port") = 25
>
> objMessage.Configuration.Fields.Update
>
> objMessage.Send
>
> i dont have much background about CDO, i just want to know
> why the script include lines such
> as "("http://schemas.microsoft.com/cdo/configuration/smtpse
> rverport")"? does the pc where im running this script
> needs a internet access? and any other site i could use
> for reference about this object?
>
> thanks!!!
> marlon
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C# messaging GTi Microsoft C# .NET 2 25th May 2005 08:28 PM
Messaging Don Dunlap Windows XP General 10 12th Feb 2005 04:50 PM
Messaging Microsoft Outlook Installation 0 6th Oct 2004 05:12 PM
msn messaging =?Utf-8?B?bWFj?= Windows XP Messenger 1 30th Dec 2003 08:31 PM
LAN messaging bilg Windows Networking 7 10th Sep 2003 06:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:16 PM.