Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 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 April 8th, 2004, 05:33 AM
Registered User
 
Join Date: Apr 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Imar,

I have modified my code based on the URL given by you. Here is the new code, but it is not working. Could you please have a look at it? And also what is the use of this parameter ".Item(cdoSendUsingMethod) = cdoSendUsingPort", because i have to try this in my local exchange server.


Dim objCDO
Dim iConf
Dim Flds

Const cdoSendUsingPort = 2

Set objCDO = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")

Set Flds = iConf.Fields

With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = <exchangeservername>
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPconnectiontimeout) = 10
.Update

End With

Set objCDO.Configuration = iConf

objCDO.From = "[email protected]"
objCDO.To = "[email protected]"
objCDO.Subject = "test"
objCDO.TextBody = "test"
objCDO.Send

'Cleanup
Set ObjCDO = Nothing
Set iConf = Nothing
Set Flds = Nothing


 
Old April 8th, 2004, 05:52 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Why did you leave out all the stuff with ("http://schemas.microsoft.com/cdo/configuration/smtpserver")?

You can take the example as is, replace just the bolded parts and it should work. If I were you, I'd try that first, and if it works, then change it to suit your situation.

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old April 14th, 2004, 03:12 AM
Registered User
 
Join Date: Apr 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Imar,

If I use the below mentioned link for SMTP server. Is there any problem ? Could you please explain me what is the use of this parameter ?

("http://schemas.microsoft.com/cdo/configuration/smtpserver")?

 
Old April 14th, 2004, 03:32 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

This parameter sets the SMTP server you want to use. The mail object will try to deliver your e-mail message at that server. This is where you should specify your Exchange server. AFAIK, that should work.

Did you try the example fro the article I showed you? If you just change the three bold parts in the code (and leave everything as is), it should work.....

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Broken Face by Pixies (Track 4 from the album: Surfer Rosa & Come On Pilgrim)

 
Old April 14th, 2004, 03:35 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Oh, and the "link" is not really a link. It's just a namespace for the smtpserver parameters. Something to make the param unique...


Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Four Minutes by Roger Waters

 
Old April 14th, 2004, 04:00 AM
Registered User
 
Join Date: Apr 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is there any harm in using that link ? I have tried with that link, it is working fine. And I have also scheduled it. Thanks a lot for your help in this regard. Thanks.........

 
Old April 14th, 2004, 04:09 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

No, there is no harm, because like I said, it's not a link, but merely a means to make the smtp param globally unique.
As you can see, the link is enclosed in quotes which makes it an ordinary string.

Internally, this text is used to set and get the name of the SMTP server, but it will never go out on the Internet to reach the schemas.microsoft.com site.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: What time is love ? (The 1988 pure trance classic) by The KLF (Track 3 from the album: What time is love ?)






Similar Threads
Thread Thread Starter Forum Replies Last Post
Web service not working properly in IIS Abhinavnaresh ASP.NET 2.0 Professional 1 April 10th, 2008 08:53 AM
ch 8 code is not working properly Dev_gh78 C# 1 August 4th, 2006 12:16 AM
Banner ad values not working properly. malhyp Dreamweaver (all versions) 3 January 17th, 2006 03:42 AM
PreparedStatement not working properly wslyhbb Java Databases 3 September 9th, 2003 01:08 PM





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