Re: Need help sending emails.
Re: Need help sending emails.
- Subject: Re: Need help sending emails.
- From: Jeff Gold <email@hidden>
- Date: Sat, 27 Nov 2010 08:16:40 -0500
I'm glad to hear you are having good luck with 24U Email OSAX, Bert.
Perhaps we can stick with 24U Email OSAX a little longer and try to locate what is causing the issue.
There are two ways we've tried running 24U Email OSAX, and each has caused numerous random crashes after about every 5 to 10 emails which are sent. The first way we tried was to activate the Applescript functions to send the email using the special Applescript commands built into the Panorama database software we use. This resulted in Panorama crashing about once for every 5 to 10 emails which were sent.
After this, to prevent Panorama from crashing, we started having Panorama generate email sending scripts as text files which are saved to disk. We then have another AppleScript script running 24/7 monitoring a folder to see if there are any emails to send. If there are, it activates the scripts one by one.
Now, the AppleScript which monitors the folder is crashing with about the same frequency Panorama did, after every 5 to 10 emails which are sent. Because of the identical crashing behavior in two different programs calling the sending email scripts, I figured it was a bug in 24U Email OSAX, but maybe we are just doing something which is not quite right? I don't know why it crashes. No error message is given. In the case of Panorama, it just quit. In the case of the script calling the email sending scripts, it just quits the same way after every 5 to 10 emails.
It doesn't matter what kind of email is being sent, or how long it is. The same script which causes a crash one time, can be re-run immediately and won't cause a crash the second time. In fact, we have our folder-watching script automatically re-launch and try again after a crash, and it will always send properly after re-launching. (We use the program Keep-It-Up to relaunch programs which crash automatically.)
Here are samples of what we are doing. First, this is a sample script of an email to be sent by Email OSAX. All emails fit this same general format. I've blocked out some things with X's to protect the privacy of some information, the X's are not in the actual script.
set mySMTP to "69.55.XX.XX"
set myFrom to "email@hidden"
set myTo to "email@hidden"
set myBcc to "email@hidden"
set mySubject to "Message From Jeff Gold"
set myBody to "This is a test email being sent using 24U Email OSAX."
set myExtraHeaders to ¬
"Mime-Version: 1.0
X-Iadb-Ip: 69.55.XX.XX
X-Iadb-Ip-Reverse: XX.XX.55.69
X-Iadb-Url: http://www.isipp.com/iadb.php
X-Priority: 1
X-Origin-IP: 69.55.XX.XX
Content-Type: text/plain; charset=iso-8859-1; format=flowed
From: Rescue Me! <email@hidden>
Reply-To: Jeff Gold <email@hidden>"
send email myBody ¬
subject mySubject ¬
from myFrom ¬
to myTo ¬
bcc myBcc ¬
via host mySMTP ¬
extra headers myExtraHeaders ¬
We've added some of our own headers, which the folks at 24U Email OSAX say should be fine. Also, We set the myFrom to the value we want to be the Return-Path (for errors) and then set the real "From" within the extra headers. This is a tip passed onto us by the programmer of 24U Email OSAX, to overcome a bug in their software which doesn't currently allow the Return-Path for errors to be different from the From address, unless you use this workaround they suggested.
Anyway, the script above gets saved in a folder with a filename like e1340.scpt. Then this folder is checked every 5 seconds using the following script which is always running 24/7 on our server. (We tried using the "folder watching" function of AppleScript but learned it is too buggy to be useful, so we essentially wrote our own folder watching script.) The following script crashes about once ever 5 to 10 email scripts which are run using the "run script" statement. All emails to be sent are similar to the one above. We don't get any crashes using the same type of script as below to run other types of tasks when it watches folders, so I'm reasonably certain it is somehow related to 24U Email OSAX. Here's the watch folder script:
runscripts()
on runscripts()
try
set myFolder to "Macintosh HD:Library:XXXXXXX:XXXXXXXXX:Scripts" as alias
repeat
tell application "Finder"
set theseFiles to every file of myFolder
end tell
if number of items in theseFiles is not 0 then
repeat with i from 1 to number of items in theseFiles
set this_item to item i of theseFiles
set delete_file to the name of this_item
set deleteFilePath to ("Macintosh HD:Library:XXXXXX:XXXXXXXX:Scripts:" & delete_file) as alias
run script deleteFilePath
tell application "Finder"
delete deleteFilePath
end tell
end repeat
end if
delay 5
end repeat
on error
delay 5
runscripts()
end try
end runscripts
Keep in mind, both of the scripts work perfectly most of the time. There are no "standard" bugs or typos in them -- or they would never work. Just randomly, after ever 5 or 10 emails, the folder watching script will just quit and needs to be relaunched. It will then resume and send any scripts in the folder without an issue, so there are no errors that ever keep stopping. Something must be causing some sort of memory leak or something which keeps on causing it to quit.
Are there any suggestions anyone can provide to help us track down the cause of the crashes?
- Jeff _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden