- there are two examples illustrating how to use mapisend (useful if you have a program such as Outlook or Outlook Express on the machine), and another example that shows how to generate emails through Procomm's built-in mail client.
I execute both scripts, and don't work. All it does it bring up the Internet "Setup" screen. What do I need to do to modify the script to make it works.
Do you already have Outlook or Outlook Express (or another MAPI-compliant mail program) installed and configured on the machine? This is necessary if you using the mapisend command.
If you are trying to use the script that sends email through Procomm's mail client, then you will need to configure it with the information it needs (mail server, username, password, etc.) before the script will work succesfully.
I got the sample from the site you recommended. I modified the script and it didn't run can you verify the script to see where I go wrong?
;****Multiple Email files script*****************************************************************
;Script written 12/03/03 by Stuart Pearson
;The aEmail_files array holds the strings that detail the list of files to attach to the email
;When the files are added the script checks that the length of the `aEmail_files[n]` string is
;under 255 characters. If adding the file increases the length above 255 a new email is created,
;this process continues until all the files specified are included.
;The script has been taken from a larger script where the various parameters i.e. Email addresses
;and the files to send are already known, for this reason I have included multiple input boxes
;to get this information.
;************************************************************************************************
proc main
string sEmailfile = "c:\sas\sastxout" ;Receives string input of file specificaton
string aEmail_files[100] ;string array for files to attach to each email
string sEmail_lne ;string for dialogbox error message
string sEmail_temp ;string to
integer iCounter = 1 ;integer used for various loops
integer iE_counter = 1 ;integer to log number of files to send
integer iEmail_Length ;integer to record length of email file string
integer iTemp_Length ;integer to check modified email string length
;is less than 255
string sMailLogon = "bnguyen" ;Mail logon/profile name
string sMailPassword = "Jen123" ;Not needed if using Exchange Server
string sTo = "bao.nguyen@logixcom.com" ;Recipients as they appear in the Outlook address book or enter just email address
string sCC = "" ;CC recipients
string sBCC = "" ;BCC recipients
string sSubject = "Email from Procomm" ;Subject of the message
string sContents = "test mail" ;text appearing in body of message
string sMailError ;Holds any returned errors
sdlginput "Enter Mail Logon/profile Name" "Logon/Profile Name:" sMailLogon DEFAULT
sdlginput "Enter Mail Password - not needed for Exchange Server" "Logon Password" sMailPassword DEFAULT
sdlginput "Enter Email Send Address" "To:" sTo DEFAULT
sdlginput "Enter Email CC Addresse(s) seperated by ;" "CC:" sCC DEFAULT
sdlginput "Enter Email BCC Addresse(s) seperated by ;" "BCC:" sBCC DEFAULT
sdlginput "Enter File Specification" "File Spec." sEmailfile DEFAULT
while iCounter !=100
aEmail_files[iCounter]=""
iCounter ++
endwhile
iE_counter=1
The script you modified is one that requires a MAPI-compliant program (like Outlook) to send the email. Procomm's mail client does not fall under this category, though. Do you have Outlook on that machine? If not, you'll either need to modify the mail.was script (located about halfway down the samples page) or install Outlook or a similar mail program to use the script you modified.
What I found was that the string sMailLogon = "" ;Mail logon/profile name
needed to be set to something entirely different than I would have figured. It had to be set to the value which can be found by going to Outlook's Tools/Options Mail Services tab: If using MS Exchange Server at the top you'll probably have a check mark by 'Always use this Profile. The profile name in the field to the right of this is what I had to put in my 'sMailLogon' variable.
In my case it is set to: "CompanyName Mail"
In th drop down I noticed the default: "MS Exchange Settings".
Hope this helps using the MapiSend with Outlook. DT
Good point, I have this tidbit mentioned elsewhere on my site, but don't have a comment about it in the sample scripts. I'll make that change later today.
Another question. How can I eliminate all the prompts? My script is going to run automatically with any human intervention and I would like to send email out every time my procomm script is complete. This would be helpfull.
Which script are you running, the one that uses Procomm's email client or the other script that uses mapisend? Some versions of Outlook do not allow other programs to send mail through Outlook automatically (a message box is displayed warning of this fact), but I saw a program over the weekend that will sit in the system tray and answer yes to this prompt. I have it bookmarked on my home machine if you need it.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.