<MvSMTP> headers and .pdf attachments

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rjdelbueno
    Mini Mivite

    • Feb 2008
    • 41

    #1

    <MvSMTP> headers and .pdf attachments

    I have a strange issue I think is related to header information when using <MvSMTP> to create emails that contain .pdf attachments.
    Everything functions fine except that for users of yahoo mail (those with an @yahoo.com) email address, the attachment is not recognized as part of the email.
    Is there anyone out there that would be willing to let me send you a sample email generated with my implementation <MvSMTP>?
    If so, email me directly at [email protected]

    Here is my current code:

    <mvassign name="l.cr" value="{asciichar(13)$asciichar(10)}">

    <mvassign name="l.encoded_content" value="{Encode_64('/accounts/sgi/manifests/'$ l.manifestno $'.pdf')}"><MvComment>Path of .pdf file to be attached</MvComment>

    <mvassign name="l.encoded_content" value="{Chunk(l.encoded_content)}">

    <MvSMTP
    TO="{ l.EMAIL_TO }"
    SUBJECT="{ l.EMAIL_SUB }"
    MAILHOST="localhost"
    FROM="{ l.EMAIL_FRM }"><MvEVAL EXPR="{
    'MIME-Version: 1.0' $ l.cr
    $'Content-Type: multipart/mixed; boundary=----=_NextPart_000_020D_01C3FB44.3DF09230' $ l.cr

    $'X-Priority: 3' $ l.cr
    $'X-MSMail-Priority: Normal' $ l.cr

    $'X-MimeOLE: Produced By Southern Green Industries - www.southerngreeninc.com' $ l.cr $ l.cr
    $'This is a multi-part message in MIME format.' $ l.cr$ l.cr
    $'------=_NextPart_000_020D_01C3FB44.3DF09230' $ l.cr

    $'Content-Type: text/plain;' $ l.cr
    $' charset="iso-8859-1"' $ l.cr
    $'Content-Transfer-Encoding: 8bit' $ l.cr$ l.cr

    $ l.EMAIL_BDY $l.cr$l.cr

    $'------=_NextPart_000_020D_01C3FB44.3DF09230' $ l.cr


    $'Content-Type: application/pdf; name='$ l.manifestno $'.pdf' $ l.cr
    $'Content-Transfer-Encoding: base64' $ l.cr
    $'Content-Disposition: attachment; filename='$ l.manifestno $'.pdf' $ l.cr
    $ l.cr $ l.encoded_content $l.cr$l.cr
    $'------=_NextPart_000_020D_01C3FB44.3DF09230--' }">
    </MvSMTP>

    <MvFunction Name="Encode_64" Parameters="filename" Standardoutputlevel="compresswhitespace">
    <MvASSIGN NAME = "l.file_length" VALUE = "{ file_read( l.filename, 'script', l.file ) }">
    <mvassign name="l.ret" value="{crypto_base64_encode(l.file)}">
    <MvFuncreturn Value="{l.ret}">
    </mvfunction>

    <mvcomment> Chunk </mvcomment>
    <MvFunction Name="Chunk" Parameters="content" Standardoutputlevel="compresswhitespace">
    <mvassign name="l.rt" value="{asciichar(13)$asciichar(10)}">
    <mvassign name="l.length" value="{(len(l.content))/76}">
    <mvassign name="l.cnt" value="1">
    <MvWHILE EXPR="{ l.tt LT l.length }">
    <mvassign name="l.tt" value="{l.tt+1}">
    <mvassign name="l.lettre" value="{substring(l.content,l.cnt,76)}">
    <mvassign name="l.cnt" value="{l.cnt+76}">
    <mvassign name="l.ret" value="{l.ret$l.lettre$l.rt}">
    </MvWHILE>
    <MvFuncreturn Value="{l.ret}">
    </mvfunction>
  • Gordon - Phosphor Media
    Developer Partner


    • Mar 2006
    • 448

    #2
    Re: &lt;MvSMTP&gt; headers and .pdf attachments

    Have you looked at Send_Email_Attachment() in the LSK?

    (Of course, you may be trying to do this outside of Merchant.)

    I would suspect a stray crlf that most mail servers handle without complaining.
    Gordon Currie
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit Any Document Easily | Free Modules | Follow Us on Facebook
    phosphormedia.com

    Comment

    • rjdelbueno
      Mini Mivite

      • Feb 2008
      • 41

      #3
      Re: &lt;MvSMTP&gt; headers and .pdf attachments

      Yes, this is outside of merchant.
      I will try to find any stray crlfs, thanks for the tip.
      Anybody out there good with headers care to take a look if I send you a sample email? ;)

      Comment

      • Rick Wilson
        Uber Mivite











        • Aug 2007
        • 10119

        #4
        Re: &lt;MvSMTP&gt; headers and .pdf attachments

        Our CTO tested your code and it worked for him, fwiw. Could be an issue with your mail sender.
        Thanks,

        Rick Wilson
        CEO
        Miva, Inc.
        [email protected]
        https://www.miva.com

        Comment

        • rjdelbueno
          Mini Mivite

          • Feb 2008
          • 41

          #5
          Re: &lt;MvSMTP&gt; headers and .pdf attachments

          Hi Rick. Thanks.
          Do you know if it was tested specifically with a receiving Yahoo.com email address?
          That seems to be the only mail service that shows the issue, so it "works" most of the time, just not with yahoo on the receiving end.

          Comment

          • Rick Wilson
            Uber Mivite











            • Aug 2007
            • 10119

            #6
            Re: &lt;MvSMTP&gt; headers and .pdf attachments

            I think he just sent it to himself (non yahoo) and concluded it was "Yahoo weirdness".
            Thanks,

            Rick Wilson
            CEO
            Miva, Inc.
            [email protected]
            https://www.miva.com

            Comment

            Working...
            X