Adam,
Here's a sub-routine I use to send via Outlook.
Hope it helps you.
Regards,
Dave Griffin
Declare Sub SendMes(strRcp as String,strFilePath As String, strSalutation as String, strCustYYMM as String)
Sub Main()
Dim objPPApp As Object
Dim objPPRep As Object
Dim ReportPath$, Salutation$, CustYYMM$
Dim ImpApp As Object
Dim ImpRep As Object
On Error Goto ErrorHandler
Recipient = "SMTP or Exchange Name Here"
ReportPath = "Report file (PDF or Other) and Path here"
Salutation = "First Name Here"
CustYYMM$ = "139910"
Call SendMes(Recipient,ReportPath,Salutation,CustYYMM)
Set objTask = Nothing
Set objSchedApp = Nothing
'Finish the routine
'------------------
Finish:
Exit Sub
ErrorHandler:
MsgBox("Error: "+Error$)
'MsgBox("Error: "+CPApp.GetErrorNumber)
resume Finish
End Sub
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub SendMes(strRcp as String,strFilePath As String, strSalutation as String, strCustYYMM as String)
Dim objOutlook As Object
Dim objMail As Object
Dim objOutlookAttach As Object
Dim arrFileList() as String
Dim i as Integer
Dim strBodyMess as String
redim arrFileList(4)
i = 1
strBodyMess = "Hi "+strSalutation+","+Chr$(13)+Chr$(13)
strBodyMess = strBodyMess+"Your Invoice Files are attached "+Chr$(13)+Chr$(13)
strBodyMess = strBodyMess+"Files prepared and send via CognosScript(tm) Macro"+Chr$(13)+Chr$(13)
arrFileList(1) = strFilePath+"\"+strCustYYMM+"IV.PDF"
arrFileList(2) = strFilePath+"\"+strCustYYMM+"LB.PDF"
arrFileList(3) = strFilePath+"\"+strCustYYMM+"OD.PDF"
Set objOutlook = CreateObject("OutLook.Application"

Set objMail = objOutlook.CreateItem(olMailItem) 'Create a new
Set objOutlookAttach = objOutlook.CreateItem(olAttachMents)
With objMail
.To = strRcp
.Subject = "Your Monthly Invoice & Supporting Files" 'Subjectline of message
'.Body = "Hi " & strSalutation & "," & Chr$(13) & Chr$(13) & "Your Invoice Files are attached "
.Body = strBodyMess
for i = 1 to 3
.Attachments.Add(arrFileList(i))
next i
.Send 'Send the message
End With
Set objMail = Nothing
Set objOutlook = Nothing
End Sub