• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: XMail and FMPro
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XMail and FMPro


  • Subject: Re: XMail and FMPro
  • From: jj <email@hidden>
  • Date: Mon, 03 Apr 2006 22:14:58 +0200
  • Thread-topic: XMail and FMPro

> Hello,
>
> I just downloaded XMail to use with FMPro 8, since we had so many
> problems with Mail quitting on us when we sent pdf's as attachments.
> However, I'm having a problem with XMail attachments sent to a PC.  I
> hope this is the right place to ask.
>
> If I send a pdf to myself, it shows up fine in Mail.  However, when
> I send the same pdf to a vendor, they can't open it on their PC.
> Here's the AS code I'm using (variables are set in FMPro:
>
> I'm not compressing the pdf, since it worked uncompressed when I
> used Mail.  Do I need to encode the attachment differently for a PC?

No. "base64" works just fine. I wrote the code you posted some time ago, but
it's now an oldie ;-)

I think the main issue was using "multipart/alternative" instead of
"multipart/related" (supported by most of email clients).


Try this instead:

############################################
set tofield to "email@hidden"
set fromfield to "email@hidden"
set smtpServer to "smtp.bar.net"

--> fill the three following ones if needed, or delete them
set username to "bar"
set |password| to "coffee"
set authentication to auto

set theSubject to "Test!"
set theBody to "Hello, Dolly..."
set thePDF to (choose file with prompt "Choose a PDF file...")
set filename to name of (info for thePDF)
set base64attachment to ¬
 (do shell script "openssl base64 < " & quoted form of POSIX path of thePDF)

set mimebound1 to mime bound
set mimebound2 to mime bound

set rawSource to "Date: " & (mail date) & return & ¬
    "To: " & (encode email address tofield) & return & ¬
    "From: " & (encode email address fromfield) & return & ¬
    "Subject: " & (encode mime style theSubject) & return & ¬
    "Mime-Version: 1.0
X-Mailer: XMail
Content-Type: multipart/related; boundary=\"" & mimebound1 & "\"

This is a multi-part message in MIME format.
If you see this message, then you aren't using a
MIME compliant mail reader.

--" & mimebound1 & "
Content-type: multipart/alternative; boundary=\"" & mimebound2 & "\"

--" & mimebound2 & "
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

" & (quoted printable theBody) & "

--" & mimebound2 & "--

--" & mimebound1 & "
Content-Transfer-Encoding: base64
Content-Type: application/pdf; name=\"" & filename & "\"
Content-Disposition: attachment

" & base64attachment & "

--" & mimebound1 & "--
"

try
    send raw mail to tofield from fromfield raw source rawSource ¬
        SMTP server smtpServer username ¬
        |username| password |password| authentication |authentication|
on error number -2753
    send raw mail to theAddress from theSender ¬
        raw source rawSource SMTP server smtpServer
end try
############################################

Good luck!


jj

--
http://www.macscripter.net/
http://www.osaxen.com/


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >XMail and FMPro (From: Ted <email@hidden>)

  • Prev by Date: Re: XMail and FMPro
  • Next by Date: Re: XMail and FMPro
  • Previous by thread: Re: XMail and FMPro
  • Next by thread: Re: XMail and FMPro
  • Index(es):
    • Date
    • Thread