1
嘗試從樣式表中使用url-open在XI50固件3.8.2上通過smtp構建和發送帶有附件的電子郵件。似乎無法讓附件工作....附件和MIME頭的內容在郵件消息中顯示爲普通文本。url-open smtp mime附件問題
的XSL ......(這只是簡單的東西來證明到目前爲止概念)
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:date="http://exslt.org/dates-and-times"
xmlns:dp="http://www.datapower.com/extensions"
extension-element-prefixes="dp"
exclude-result-prefixes="dp">
<xsl:output method="xml" version="1.0" standalone="yes"/>
<xsl:template match="/">
<xsl:variable name="emailServer">smtp0.mycompany.com</xsl:variable>
<xsl:variable name="domain">mycompany.com</xsl:variable>
<xsl:variable name="mimeStuff">
MIME-Version: 1.0
Content-Disposition: attachment; filename="stuff.txt"
Content-Type: text/plain
Here is some text for the attachment.
</xsl:variable>
<xsl:variable name="msgSender">[email protected]</xsl:variable>
<xsl:variable name="msgSubject">NON MULTIPART - <xsl:value-of select="date:date-time()"/></xsl:variable>
<!-- URL encode the values before building the url-open function -->
<xsl:variable name="encSender" select="dp:encode($msgSender,'URL')"/>
<xsl:variable name="encRecipient" select="dp:encode(dp:variable('var://context/msgRtr/emailRecipient'),'URL')"/>
<xsl:variable name="encSubject" select="dp:encode($msgSubject,'URL')"/>
<xsl:variable name="smtpURL">smtp://<xsl:value-of select="$emailServer"/>:25/?MIME=true&Domain=<xsl:value-of select="$domain"/>&Recpt=<xsl:value-of select="$encRecipient"/>&Sender=<xsl:value-of select="$encSender"/>&Subject=<xsl:value-of select="$encSubject"/></xsl:variable>
<xsl:variable name="resultSet"><dp:url-open target="{$smtpURL}" response="responsecode-ignore"><xsl:value-of select="$mimeStuff"/></dp:url-open></xsl:variable>
</xsl:template>
</xsl:stylesheet>
的SMTP通話作品,電子郵件到達,但附件的MIME頭和文本內容到貨作爲電子郵件中的文本,不會創建任何附件。
我錯過了什麼,我需要做什麼才能讓電子郵件創建附件?
感謝您的幫助....