Showing posts with label activex. Show all posts
Showing posts with label activex. Show all posts

Monday, March 19, 2012

Error in sending mails !

I am trying to send email thro DTS using Activex Script.

Here is the code :

'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************

Function Main()
const SMTP_SERVER = "MPBAKOREX01.corp.mphasis.com"

set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields

With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPickup
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTP_SERVER
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 90
.Update
End With


With iMsg
Set .Configuration = iConf
.To = "ausrg@.yahoo.com"
.From = "shanmuga.r@.mphasis.com"
.Subject = "TEST"
.HTMLBody = "jfldsajfldk;sajf ;lksadjf;lkasdjlfkjasdlkfjlasdkj flkdsajflsadjf ljasdlf a"
.Send
End With


Main = DTSTaskExecResult_Success
End Function

When i am executing this , i am getting the following error :


Error Source : Microsoft Data Transformation Services (DTS) Package

Error Description : Error Code: 0

Error Source= CDO.Message.1

Error Description: The "SendUsing" configuration value is invalid.

Error on Line 27

How to solve it ?

Hi,

You question has nothing to do with SSIS (or DTS) and more about CDO programming in VBScript. This is SSIS group, I doubt you'll find many CDO experts here.

The best advice you'll get in this forum is to move to SSIS - there is a nice SMTP Mail Task that will likely do what you need.

Regards,
Michael.

|||

ohh Thanks michael

|||Try searching, this will have been answered before on the DTS newsgroup -http://groups.google.com/advanced_search?q=+group%3Amicrosoft.public.sqlserver.dts|||

Hi DarrenSQLIS,

Thanks. But i dont have access to the site which u mentioned. Can you plz details the article in that site ?

:)

Sunday, February 19, 2012

Error in ActiveX script in DTS

Hi,
When i m trying to execute the following function i m getting
Error Message is Invalid Procedure Call or arguement DTSSource

'************************************************* *********************
' Visual Basic Transformation Script
'************************************************* ***********************

' Copy each source column to the destination column
Function Main()
DTSDestination("acct_id") = DTSSource("Account_ID")
DTSDestination("acct_nm") = DTSSource("Account_Name")
DTSDestination("acct_type") = 1
DTSDestination("acct_sts") = DTSSource("Enabled")

Main = DTSTransformStat_OK
End Function

thnks in advanceis DTSDestination("acct_type") of type integer,numeric or decimal?

if not, I think you have to add double quotes around the "1". Hope it helps :)