Wednesday, January 19, 2022

#1 2005-10-03 12:36:29 pm

MarkAshley
Member
Registered: 2005-08-29
Posts: 23

Sending mail

When I run the following script, the message is created and I can see it open on the screen.

Applescript:


tell application Mail
   set newMessage to make new outgoing message
   tell newMessage
       set subject to "Email Received"
       set content to messageBody
       set visible to true
       set sender to "Notification Service"
       make new to recipient at end of to recipients with properties {name:"Mark Ashley", address:"priv@te.com"}
       activate
   end tell
end tell

If I change activate to send, then I hear the sound Mail makes when it sends a message, but the message doesn't go in to the Sent box and the message never arrives.

What am I doing wrong?

Thanks
Mark

Offline

 

#2 2005-10-03 04:35:43 pm

kai
Member
From:: Brighton, UK
Registered: 2005-05-28
Posts: 912

Re: Sending mail

Hmm... works fine here, Mark - obviously with personal details changed (and "Mail" quoted).

That 'sender' property seems a bit suspect to me - since it doesn't look like a valid account. If I try to use "Notification Service" in the same way, it shows up as red in the Account pop-up menu of the new message (indicating an email account in a domain that isn't "safe"). The send fails under these conditions. hmm


kai

Offline

 

#3 2005-10-03 11:49:37 pm

MarkAshley
Member
Registered: 2005-08-29
Posts: 23

Re: Sending mail

Ahhh yes, it was the Sender property that was causing it. I thought this would change the "From" field on the recipient's email.

I've removed the line and it's working now - thanks very much.

Cheers
Mark

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)