日期:2014-05-20  浏览次数:20375 次

关于jmail发送附件的2个问题
strLink   =   "http://localhost/prj/login.aspx?address= "   +   strId   +   "& "   +   "Status= "   +   strStatusId   +   "& "   +   "Number= "   +   strNumber   +   "& "   +   "ProNumber= "   +   strJobNumber   +   "& "   +   "Methtype= "   +   strMethType   +   "& "   +   "Meth= "   +   strMeth
                strLink   =   "   <a   href= "   +   strLink   +   "> "   +   strLink   +   " </a> "
                JMail   =   Server.CreateObject( "JMail.SMTPMail ")
                JMail.Logging   =   True
                JMail.ContentType   =   "text/html "
                JMail.ServerAddress   =   "172.X.X.X "
                JMail.Sender   =   "aa@xx.com "
                JMail.Subject   =   "Project   Design   --- "   +   strJobNumber
                JMail.Body   =   strLink
                  JMail.AddAttachment(“C:\1.txt”)
                JMail.AddRecipient( "xx@xx.com ")


目前有2个问题
1     发送附件,一定是要此附件在服务器上吗。是不是一定要上传到服务器上,然后再发。
2     我在本定发送后,发现如果有JMail.ContentType   =   "text/html "
,我的附件会出现在正文。而且是乱码,但是没有这句话,我在正文的地址链接将会没有用。
请问我该如何解决

------解决方案--------------------
记得是要上传一服务器上的

发送附件的时候不要有JMail.ContentType = "text/html "

------解决方案--------------------
一定要上传到服务器,这个是肯定的
另外记得按如下设置编码
jmail.Encoding= "base64 ";
jmail.ContentType= "multipart/related ";