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>
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>
Comment