I am using XPSMTP available fromhttp://www.sqldev.net/xp.htm. It appears to be working fine but I keep getting Error: connecting to server servername. I am able to ping servername from the SQL Server. I have configured Outlook Express to send email using servername and it works. The connection only seems to fail when using th xp. Anyone have any ideas what to look for? Thanks, Eva
The link you have given is not working See if this helps you CREATE PROCEDURE SendMail( @From varchar(255), @To varchar(255), @Message varchar(8000), @Subject varchar(255)) AS DECLARE @CDO int, @OLEResult int, @Out int --Create CDONTS.NewMail object EXECUTE @OLEResult = sp_OACreate 'CDONTS.NewMail', @CDO OUT IF @OLEResult <> 0 PRINT 'CDONTS.NewMail' EXECUTE @OLEResult = sp_OASetProperty @CDO, 'BodyFormat', 0 EXECUTE @OLEResult = sp_OASetProperty @CDO, 'MailFormat', 0 --Call Send method of the object execute @OLEResult = sp_OAMethod @CDO, 'Send', Null, @From, @To, @Subject, @Message, 1 --0 is low 1 is normal IF @OLEResult <> 0 PRINT 'Send' --Destroy CDO EXECUTE @OLEResult = sp_OADestroy @CDO return @OLEResult Madhivanan Failing to plan is Planning to fail
Hi Eva, When you say you are able to ping from SQL Server, does this mean that the following code returns 0? It could be that the XP isnt installed properly?!? Ben
Hope you've patched up the service pack 2 for XP as listed herehttp://www.microsoft.com/sql/techinfo/administration/2000/security/winxpsp2faq.asp link. Satya SKJ Moderator http://www.SQL-Server-Performance.Com/forum This posting is provided “AS IS†with no rights for the sake of knowledge sharing.