MAPI Error 273--From Chapter 8 -306 pgno
Hello Gurus,
sending email from DTS getting error MAPI logon failed 273.
DB Server has mS outlook installed with a MAPI configuration(i can send mail from here)
any suggestions
Jay
Dim oPackage
Dim oMailTask 'oCustomTask1
Dim oMail 'holds send mail task object
Dim oStep
Set oPackage = DTSGlobalVariables.parent
'Clean the task if there is already exists
For Each oMailTask in oPackage.Tasks
If oMailTask.Name = ("DTSSendMailTask_runtime") Then
oPackage.Tasks.Remove ("DTSSendMailTask_runtime")
End if
Next
'Clean the Steps if there is already exists
For Each oStep in oPackage.Steps
If oStep.Name = "AutoMailSend" Then
oPackage.Steps.Remove "AutoMailSend"
End if
Next
'Adding a new step to this package
Set oStep = oPackage.Steps.New
'invoking DTSSendMailTask method for a task
Set oMailTask = oPackage.Tasks.New("DTSSendMailTask")
'Give a namefor the task you are invoking
oMailTask.Name =("DTSSendMailTask_runtime")
'best way of calling it shorty oMail.CCLine ="ESSSystems" OR "oMailTask.CustomTask.CCLine ="ESS Systems"
Set oMail = oMailTask.CustomTask
oMail.Profile = "Default Outlook Profile"
oMail.ToLine = "Barb Nelson"
oMail.CCLine ="ESSSystems"
oMail.Subject = "Auto Integrity Check results"
oMail.MessageText = "This is an auto generated file for CPR(Contact Performance Report) integrity check." & vbCrLf
oMail.MessageText = oMail.MessageText & "For any furthur questions or concerns " & vbCrLf
oMail.MessageText = oMail.MessageText & "Regards" & vbCrLf
oMail.MessageText = oMail.MessageText & "Admin"
oMail.FileAttachments = ofilename
oStep.TaskName =oMail.Name
oStep.Name ="AutoMailSend"
oPackage.Steps.Add oStep
oPackage.Tasks.Add oMailTask
oPackage.Steps("AutoMailSend").Execute
oPackage.Tasks.Remove ("DTSSendMailTask_runtime")
oPackage.Steps.Remove("AutoMailSend")
|