{{tag>category:"OpenInsight 32-bit Specific"}}
[[https://www.revelation.com/|Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community]]
==== MAPISendMail Multifiles (OpenInsight 32-bit Specific) ====
=== At 09 FEB 2011 01:34:28AM Barry Stevens wrote: ===
First time (I think) I have had to send multiple attachments in an email. Works with 1 file try 2 files get messages that file cant be found. Tried to decipher the meaning of the POS_POSITIONS$ field to see if it is related to multi files, but don't understand it. Running 9.2.1 - I am assuming not beta bug.
Is the following correct:
Message='
Message=Subject
Message=Email
Message=TxtBodys
Message=IPM."
Message=Doc1 test.PDF":@vm:"Doc2 test.PDF"
Message=C:\EMAILPDF\Doc1 test.PDF":@vm:"C:\EMAILPDF\Doc2 test.PDF"
Message=( len( message) - 2 )
if MAPISendMail(0, 0, Flags, Message) then
----
=== At 10 FEB 2011 08:10AM Dave Harmacek wrote: ===
Check out and consider the S/SMTP offer from Sprezzatura, http://www.sprezzatura.com, see the Announcements for links and documentation.
Dave
----
=== At 10 FEB 2011 09:09AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote: ===
Thanks Dave - hopefully one of those cases where what is delivered is not worth what you pay for it given it's free :).
[url=http://www.sprezzatura.com]The Sprezzatura Group[/url]
[url=http://www.sprezzatura.com/blog]The Sprezzatura Blog[/url]
[i]World leaders in all things RevSoft[/i]
[img]http://www.sprezzatura.com/zz.gif[/img]
----
=== At 10 FEB 2011 03:25PM Barry Stevens wrote: ===
It is not shown on your site anymore, also, the other utils that are shown have no 'more' links.
----
=== At 10 FEB 2011 08:24PM Dave Harmacek wrote: ===
When I go to their site, on the right is an Announcements section which reads:
15th October 2010
We're pleased to announce the release of version 1.2.1 of S/SMTP, our freeware SMTP client for OpenInsight, which you can find here. This version fixes a bug when connecting to a mail server over SSL.
More details on S/SMTP can be found in this blog post.
If I click on the "here" it offers to download a .zip file.
http://www.sprezzatura.com/downloads/products/zz_smtp/latest/zzxSMTP%20Object%20Code%20-%20Full%20Version%201.2.1.zip
Dave
----
=== At 10 FEB 2011 09:19PM Barry Stevens wrote: ===
Ahhh, that was sneaky, thanks
----
=== At 13 FEB 2011 12:04AM Barry Stevens wrote: ===
Can anyone tell me if the following is correct:
Message='
Message=Subject
Message=Email
Message=TxtBodys
Message=IPM."
Message=Doc1 test.PDF":@vm:"Doc2 test.PDF"
Message=C:\EMAILPDF\Doc1 test.PDF":@vm:"C:\EMAILPDF\Doc2 test.PDF"
Message=( len( message) - 2 )
What about Message , whare the help says it is @vm delimited - is that related to @vm file list.
----
=== At 13 FEB 2011 01:05AM Barry Stevens wrote: ===
Here is what I am testing with..this code returns error mapi 11 attachment not found. If the lines:
FullFileNames=C:\EMAILOUTS\JobQuoteDetails809A.PDF"
FullFileNames=C:\EMAILOUTS\JobQuoteDetails809.PDF"
are commented out, email is sent.
*****************************************
function test_mapisendmail(Void)
*
*Returns 1 if error
*
declare subroutine Msg, Get_Status
declare function MapiSendMail, MAPILogon, MAPILogoff, Unassigned, Dialog_Box
$insert Mapi_Equates
equ CRLF$ to \0D0A\
equ CR$ to \0D\
equ LF$ to \0A\
equ TAB$ to \09\
equ null$ To ''
*Session="
* Flags=MAPI_LOGON_UI$
* x=Set_Status(0)
* check=MAPILogon(session, @window, '', '', flags)
* if Get_Status(ErrCode) then
* Call FsMsg()
* end
Email=barry@bsbsoft.com.au"
FullFileNames=null$
FullFileNames=C:\EMAILOUTS\JobQuoteDetails809B.PDF"
FullFileNames=C:\EMAILOUTS\JobQuoteDetails809A.PDF"
FullFileNames=C:\EMAILOUTS\JobQuoteDetails809.PDF"
FileNames=null$
cnt=Count(FullFileNames,@vm) + (FullFileNamesnull$)
For x=1 To cnt
FileNames=FullFileNames-1,'B\'
Next x
TxtBody=This is one line"
Company=TESTING COMPANY"
Subject=TESTING SUBJECT"
Message='
Message=Subject
Message=Email
Message=TxtBody
Message='
Content_Type= "IPM."
Message=Content_Type
Message=FileNames
Message=FullFileNames
Message=( len( message) - 2 )
RetVal=0
x=Set_Status(0)
if MAPISendMail('','','', Message) then
Msg(@window, "Email to ":Company:" sent successfully!":@fm:"T1")
end else
Get_Status(ErrMsg)
Msg(@window, "Email to ":Company:"!":ErrMsg)
RetVal=1
end
Return RetVal
*******************************************
----
=== At 16 FEB 2011 01:39PM Barry Stevens wrote: ===
Is anyone able to give me an answer on this. I have sprezz util working, now user needs a return receipt.
Can you or cant you sent multiple attachments using MAPISendmail.
----
=== At 16 FEB 2011 07:00PM cpates@sprezzatura.com wrote: ===
Barry,
If you're using our SMTP library you should have the source to one of the smtp_Sendxxxx functions:
[list]
[*]smtp_SendText
[*]smtp_SendHTML
[/list]
If you look in there you'll see a message being built using smtp_Set_Property to set the MSG property...
e.g.
...
objxArray := @rm : smtpID
propArray := @rm : "MSG.FROM"
dataArray := @rm : sender
if len( replyTo ) then
objxArray := @rm : smtpID
propArray := @rm : "MSG.REPLYTO"
dataArray := @rm : replyTo
end
objxArray := @rm : smtpID
propArray := @rm : "MSG.TO"
dataArray := @rm : toList
...
call smtp_Set_Property( objxArray, propArray, dataArray )
All you need to do is:
[list=1]
[*]Take a copy of the function
[*]Rename it to something like BS_SMTP_SendHTML()
[*]Add an extra argument to pass in the receipt-to address
[*]Add an extra statement to set the MSG.RECEIPTTO property like so:
[/list]
...
objxArray := @rm : smtpID
propArray := @rm : "MSG.FROM"
dataArray := @rm : sender
if len( replyTo ) then
objxArray := @rm : smtpID
propArray := @rm : "MSG.REPLYTO"
dataArray := @rm : replyTo
end
objxArray := @rm : smtpID
propArray := @rm : "MSG.TO"
dataArray := @rm : toList
* // Request a read-receipt - set the MSG.RECEIPTTO
* // property to the address the receipt should be
* // sent to ...
* //
* // e.g receiptTo=someone@email.com"
objxArray := @rm : smtpID
propArray := @rm : "MSG.RECEIPTTO"
dataArray := @rm : receiptTo
...
call smtp_Set_Property( objxArray, propArray, dataArray )
cpates@sprezzatura.com
[url=http://sprezzblog.blogspot.com/]Captain's Blog[/url]
[url=http://www.sprezzatura.com]Battlestar Sprezzatura - BSG 77[/url]
[i]Colonial leaders in all things RevSoft[/i]
[img]http://www.sprezzatura.com/zz.gif[/img]
----
=== At 16 FEB 2011 07:09PM cpates@sprezzatura.com wrote: ===
Barry,
To answer your other question you should be able to send multiple files via MAPI. Can't say we've used this in a long time but here's a snippet of code from one of our MAPI email programs that worked:
...
* // NOTE: dataArray contains the MAPI message to send
* // And set the position at the end of the message
noOfAttachments = count( emailAttachments, @vm ) + 1
for x = 1 to noOfAttachments
emailMessage := " "
dataArray<POS_POSITIONS$,x> = len( emailMessage ) - 1
* // Make sure the path is fully qualified
dataArray<POS_PATHS$,x> = zzx_Utility( "RESOLVEPATH", dataArray<POS_PATHS$,x>, "" )
next
dataArray<POS_TEXT$> = emailMessage
* // Note the path to any attachments MUST be fully qualified -
* // it cannot be relative!!!!
...
cpates@sprezzatura.com
[url=http://sprezzblog.blogspot.com/]Captain's Blog[/url]
[url=http://www.sprezzatura.com]Battlestar Sprezzatura - BSG 77[/url]
[i]Colonial leaders in all things RevSoft[/i]
[img]http://www.sprezzatura.com/zz.gif[/img]
----
=== At 17 FEB 2011 02:23PM Barry Stevens wrote: ===
]]dataArray=len( emailMessage ) - 1
Thank you, I thought that was the culprit...thank you ever so much.
----
=== At 17 FEB 2011 02:24PM Barry Stevens wrote: ===
Wow that looks fun, I shall definitely try that and implement.
----
=== At 17 FEB 2011 03:26PM Barry Stevens wrote: ===
Cool, works....I just used the sender.
[[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=NONWORKS_READ&SUMMARY=1&KEY=ED6BE3E2983F63A68525783200241D96|View this thread on the forum...]]