Running applescript on different users account.

Hi,

The server@osx serverdomain.private is the name of the computer (well changed) because a while ago I was trying to set up a VPN not knowing the ISP blocked most ports and won’t allow you to open them and when I had apple tech support to help me they changed the name of the computer to a no-ip domain which was being used to redirect to the IP as it was not static at the time so thats become the computers name.

Anyway thats the address that showed up when I didn’t configure the file properly but now that I have and have defined my email address and SMTP server it should not be showing that although it seems to be trying to send emails through OSX’s email utility which won’t work as I do not have it enabled but it should not be trying to do that anyway any reason as to why that is?

Thanks,
Bruce

here is the smtp server

and the sasl_passwd file

EDIT:
Didn’t want to bump and did not realise that the SMTP server in the sasl_passwd file needed a port will give it another try in a second
EDIT 2:
Still not sending and just looked at the log file, it is still trying to send from OSX server mail and not from the defined email address rather strange considering it was working at one point and no changed have been made.

Right,

So I have managed to be able to get it to work using -f and -t.

Now I want to be able to use a bit of code I got from a previous forum post which repeats the script changing the recipient every time and ending the script when it reaches the end of the file.

This is what I have at the moment:


tell application "System Events" to set parentFolder to POSIX path of container of (path to me)
set filename to "Test.eml"
set message to parentFolder & "/" & filename

display dialog "Choose Mail Group" buttons {"test", "Test Bulk", "bulktest"}
if result = {button returned:"test"} then
	set theGroups to "test"
	set theFileName to "test.csv"
	set theEmailGroup to paragraphs of (do shell script ("egrep -o '\\b[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z0-9.-]+' " & quoted form of (parentFolder & "/" & theFileName)))
end if
set EmailAddresses to theEmailGroup
repeat with i from 1 to count of EmailAddresses
	
	
	do shell script "sendmail -f my@email.co.uk -t  & EmailAddresses <" & quoted form of message
end repeat

I can’t seem to get the variable EmailAddresses to work as it is within the quotation marks and when I move it out of them the script expects end of line.

Can anybody help with this?

Thanks,
Bruce

probably


 do shell script "sendmail -f my@email.co.uk -t " & item i of EmailAddresses & " <" & quoted form of message

ah, I was almost there when i put it outside of the quotation marks, was just missing the & at the end of it.

Thanks for that :slight_smile:

Bruce