Setting message STMP server with Mail.app ??

Final remarK:

I had this script initially:

set sendMail to POSIX path of (path to resource "sendEmail")

But when executing, it returned error:

Hence why I gave a direct path reference in the first quoted script:

set sendMail to "/usr/local/bin/sendEmail"

Don’t know if this explains why I am having problems…

Hello!

I’d try to set up gmail as an account in apple mail. When you have done that, and made that work, then you know a lot more. Maybe even mail.app helps you configure it! :wink: I have not set up a gmail account in apple mail, but I belive you may find that the smtp port number may be different. Maybe the ssl port 587 is the right one to use, really!

Thanks for the response. I have the account set up in Mail and use port 465 without difficulty with Mail.

With my script, I did try port 25 as well, just in case, but got the same result. And 587 brings up same error (just tried) :frowning:

Cheers

Hello

Have you tried to enter the command from commandline, and does it work then?

And which directory if any are you in then, you should also pipe your environment into a file, to see if there is any variables, that sendmail depends upon. you can start by issuing the command

set |more

To have a look at them.

Maybe you should also have a sleep after your sendmail command, before returning, to give the senmail a chance to process, before the connection is teared down again. This is just a shot in the dark! :slight_smile:

Hey McUsr

Great suggestion. What was happening was that Little Snitch was blocking the perl process. So now I have it working from command line. Email successfully sent.

Thanks

:slight_smile:

Just one last issue on this. When I email the clipboard, any accented characters arriving on a windows machine are garbled.

I have tried this:

set theUnicodeText to Unicode text of (get the clipboard as record)

And I was hoping that would solve the problem, but no joy.

How does one convert text to be Windows friendly?

Cheers

Hello! :slight_smile:

man pbpaste, pbcopy, and textutil

Maybe you should try just «class UTF8», and not Unicode text first!

The correct incantation in your particular case, is described by DJ Bazzie Wazzie in the very recent thread about problems with passwords to an smb server.

I’m sorry, I meant iconv, not textutil.

I had a look at the Bazzie Wazzie post, but cannot follow it. I am afraid that shell scripting stretches my limits…

Is UTF8 a Windows format? I tried to put that into my script but could not get it to compile.

Cheers

I’m sorry, I didn’t remembert the capitalization, and guessed that AS would coerce “UTF8” to correct text, this is what I meant, and I think the character set you are looking for is iso-8859-1 (Macroman).
but give this a try.



set thetext to "æåø"
set the clipboard to thetext as «class utf8»



Hello if you put the line below in a do shell script then you will get text converted to iso-8859-1 back onto the clipboard, it may help! :slight_smile:

pbpaste |iconv -t ISO-8859-1 | pbcopy

Thanks for all this. I am not sure what is happening though. I have this:

do shell script "pbpaste |iconv -t ISO-8859-1 | pbcopy"

When the clipboard contains an accented character, the script deletes the contents of the clipboard???

Nope, it converts the accented characters to the Iso-8859-1 equivalents!

I have for instance “æåø” on the clipboard, then I run this:



do shell script "pbpaste |iconv -t ISO-8859-1 | pbcopy"

-->

I get this as result: ʯ (which looks perfectly like æåø in an iso-8859-1 encoded file.

If you have TextWrangler, you can make a document with 8859-1 encoding, and see for yourself, when you paste in the converted chars, saves it, closes it, or just reopens the document.

Weird

I put “chérie” into the clipboard, run the script and it produces “ch”

I have ClipMenu running and quit that in case it was interfering, but still get this strange result.

I don’t see ISO 8859-1 in Textwrangler. I do see ISO 8859-5 and ISO 8859-7. Getting late:( Think I will need to sleep on this.

Hello, try the procedure with iso-8859-5 instead then! :slight_smile:

Hello

I have not managed to solve the text encoding.

Could you try this script on your machine:

set the clipboard to "chérie"

set ff to do shell script "pbpaste | iconv -t ISO_8859-5 | pbcopy"

set rslt to the clipboard

This gives me the rslt “ch”. Same as when I try converting to ISO_8859-1.

Cheers

Hello!

It is not you having a prolem with this really! Every decent mail client is set up with utf-8 nowadays, tell your recipient that! :wink:

just read here, an here!

the code below works for me, this text should then be catenated, by some shell tool to comprise as the body of your email when you send it.

you may try to open it with TextWrangler , and then reopen it with western latin and you should still get chérie as a result, proving that the enoding worked. :wink:


set the clipboard to "chérie"

do shell script "pbpaste |iconv -f UTF-8 -t windows-1252 >/Users/you/path to/STUFF"
” open STUFF from commandline, or from TextWranger

Thanks. Will try this out…