I have made an applescript to send bulk mail as individual emails the only problem is that nothing can be done while it is running as it uses keystroke and the clipboard.
I have tried running it on another user but it seems to idle while that user is inactive now I would like to know to let the script run off in the back ground of another user instead of idling until the user goes back to that profile.
Would be great to see if this is possible because it could be sending unto 250 emails at a time. luckily (kind of) I made a certification error a while back so Mac’s mail has to verify before sending so it will not send anything while I am testing this and it also ignores that window while it is going on.
well if there is anyway to set the body of the message as the contents of a webpage then Im sure it can be but I have not been able to see this done yet so I am not sure.
At the moment the body of the message is made via safari opening the page then copy and pasting it into the body then it runs a check to see if that page is open if so it just pastes the clipboard into the body of the message.
Like you do on http you need to set some SMTP headers like mime type and mime version. It’s not for the mail server but it’s for the mail client who will read your mail and show the content correctly. You need something like this:
set mailMessage to quoted form of "From: firstname.lastname@example.org
Subject: MIME Test
This is a test.
do shell script "sendmail -t <<<" & mailMessage
although that does look like a good idea it has a possibility of getting a bit messy and also I have not been told how often the news letter is going to be changed (as there is plans for it to be sent out weekly it could be quite often) if it where to be changed often I would keep having to send a different applescript for the person who is sending out the bulk mail every time it changed.
Is there a possible way around it?
EDIT: Just tried it with the current news letter and it would not work was getting a lot of expression and syntax errors.
When sendmail returns “” it means that you have filled everything correctly, but th email server is probably denying something or missing some extra headers information or other parameters. Try the option -v with sendmail. When the mail isn’t send it will send a report to your local mail client. Which is probably your email@example.com which can be accessed by using the mail command line utility which can be accessed by the terminal.
My email provider can be a bit fiddly with sending emails and doesn’t always provide the right information when setting it up and will try the -v option with sendmail and I shall get back to you on that one.
I forgot to tell you that you need to set the relay host of the mail server in a config file. I have my own mail server and don’t need these settings because my mail server is inside my own network.
in /etc/postfix there is a file main.cf that is the configuration file to send and receive mail. Go to the seciont “# INTERNET OR INTRANET” and fill in the correct relay host. If you’re server requires a login name and password to send mails like you need for gmail accounts, you can find a step by step tutorial here
It’s confusing. Each line starting with ‘#’ is commentary, those relay host settings are just examples in the comments. My advice would be not to change any comments at all but add one new line below like one of those examples but this time don’t start with a hash.
I think the only thing I knew there was that ‘#’ is used for commenting in config files.
No it was more what information goes where.
I have tried the tutorial unfortunately along the way I had the directory opened in finder and it has messed the permissions up so I can’t make the .db file for the password and I have tried repairing the permissions yet it still was saying access denied when running
I don’t know the mail account so I don’t know either ;). The same information as the smtp server settings in application mail goes there.
The BSD system folders are not used to be handled by the Finder. The finder is a process running as a console user and not as a system administrator (note: system administrator is something else than administrator in Mac OS X). Therefore don’t do any file handling in the Finder for files in folders like /etc, /var, /usr for example. Use the terminal instead. If editing files with vi is too hard, you can also try nano wich is an much more easier text editor. So type in terminal
I have managed to be able to look up how to save edit using Vi now and I managed to get through the tutorial and everything is running find and it managed to build the .db of the user and password needed it but applescript is still returning the same message “Mail Delivery Status Report will be mailed to .”
any idea why this could be?
P.S. I used the tutorial as the mail server I use needes user and password.
You could also try to enforce the sender like this, not required on my machine but it could be on some:
set mailMessage to quoted form of "Subject: MIME Test
This is a test.
do shell script "sendmail -f firstname.lastname@example.org email@example.com <<<" & mailMessage
The -t means that sendmail has to parse recipients from the mail headers, now we have filled them on the command line we have to remove this option from the command line. We have instructed by editing main.cf that we have a relay server. Mail messages will be send to mail on the command line (do you see any mails there) or you have to look in the /var/log/mail.log and see if you see somthing like: