RTI_CDOMAIL configuration (OpenInsight 32-bit)
At 14 MAY 2013 06:49:12AM cmeyer wrote:
Is there a way to configure Rti_Cdomail to use outlook mail client instead of SMTP.
The client needs confirmation the email was sent and they are used to seeing emails in the sent folder.
I already send a confirmation copy to the sender but that ends up in the inbox. This confuses the client believing the email was sent to himself and not the intended recipient.
Tried to use the following but getting errors:
Function Outlook_SendMail(method, recipients,subject, body, attachmentFileList, cc)
/*
Send E-Mail using Outlook Client See http://msdn.microsoft.com/en-us/library/ms772422.aspx#officeoutlook2007whatsnewdeveloperspart1__security
For mail guard rules 17Aug1010 rjc Created -
*/ $insert logical $Insert Msg_Equates Equ olMAilITem$ To 0 Equ olOriginator$ to 0 Equ olCC$ To 2 If Assigned(method) Else method =
If Assigned(recipients) Else recipients =
If Assigned(subject) Else subject =If assigned(body) Else body =
If Assigned(attachmentFileList) Else attachmentFileList =If Assigned(cc) Else cc =
reqErrs =/* *** first check if outlook is open wscript = OleCreateInstance("MSScriptControl.ScriptControl") wscript→Language = 'JScript' expression = 'GetObject("","Outlook.Application")' obj = wscript→Eval(expression) * If no error then outlook is open exists = ( OleStatus() eq 0 ) wscript =
*/ Begin Case Case getbytesize(recipients) = 0 reqerrs<1,-1> = 'Missing Recipient' is_ok = false$ Case getbytesize(subject) = 0 reqerrs<1,-1> = 'Missing Subject' is_ok = false$ Case getbytesize(body) = 0 reqerrs<1,-1> = 'Missing Body' is_ok = false$ Case otherwise$ is_ok = true$ End case Outlook = OleCreateInstance("Outlook.Application") Gosub TestOleStat If is_ok then Message = Outlook→CreateItem(olMAilITem$) Gosub TestOleStat End If is_ok then Message→Subject = Subject Message→Body = body Gosub TestOleStat end If is_ok then oRecipients = Message→Recipients Gosub TestOleStat col =Loop Remove recipient From recipients at col setting mark If getbyteSize(recipient) Then x = oRecipients→Add(recipient) Gosub TestOleStat End While mark And is_ok repeat End If is_ok And getByteSize(cc) then col =
Loop Remove recipient From cc at col setting mark If getbyteSize(recipient) Then this_recipient = oRecipients→Add(recipient) this_recipient→Type = olCC$ Gosub TestOleStat End While mark And is_ok repeat End If is_ok then oAttachments = Message→Attachments col =Loop Remove Attachment From attachmentFileList at col setting mark If getbyteSize(Attachment) Then x = oAttachments→Add(Attachment) Gosub TestOleStat End While mark And is_ok repeat End If is_ok then x = Message→Send() Gosub TestOleStat End If is_Ok Else Msg(@window, 'Unable to send Email':@vm:reqerrs) end Return
TestOleStat: oleStat = OleStatus() if oleStat # 0 then is_ok = false$ this_err = oleStat *this_err = 'Error at step ' : step : ' ' : oleStat reqErrs<1,-1> = this_Err end return Do not know enough about OLE to fix the problem. What is the simplest way to send an email via the mail client. Any advice would be grateful. TIA Chris </QUOTE> —- === At 15 MAY 2013 03:41PM Bob Carten wrote: === <QUOTE>Hi Chris, I cut the program from your posting, pasted it into OI 9.3 and it worked for me. It should work in 8.08 too. From system monitor I typed <code> run outlook_Sendmail, '[email protected]', 'This is a test of outlook', 'this is only a test',
, '' </code> What version of office are they using? Older versions of office will block OLE automation. </QUOTE> —- === At 17 MAY 2013 05:40AM cmeyer wrote: === <QUOTE>I am using Outlook 2007. Regards Chris </QUOTE> —- === At 17 MAY 2013 07:35AM Dave Harmacek wrote: === <QUOTE>Chris, the above script worked fine for me on Outlook 2007. Dave Harmacek Harmacek Database Systems </QUOTE> View this thread on the Works forum...