首页 新闻 会员 周边 捐助

我想写一个邮箱,写了如下代码 不知为什么错了 请看看 谢谢

0
悬赏园豆:20 [已关闭问题]

protected void sendTheEmail_Click(object sender, EventArgs e)
        {
            jmail.MailMergeClass jmmc = new jmail.MailMergeClass();
            jmail.POP3Class jp3 = new jmail.POP3Class();
            jmmc.MailTemplate.Charset = "GB2312";
            jmmc.MailTemplate.Encoding = "BASE64";
            jmmc.MailTemplate.ContentType = "text/html";
            jmmc.MailTemplate.ISOEncodeHeaders =false;
            jmmc.MailTemplate.Priority = Convert.ToByte(1);
            jmmc.MailTemplate.From = SendPeople.Text.Trim();
            jmmc.MailTemplate.FromName = sendName.Text.Trim();
            jmmc.MailTemplate.Subject = EmailTitle.Text.Trim();
            jmmc.MailTemplate.AddRecipient(GetPeople.Text.Trim(),"","");
            if ("" != EmaillFileUpload.PostedFile.FileName)
            {
                string attpath = EmaillFileUpload.PostedFile.FileName;
                jmmc.MailTemplate.AddAttachment(@attpath, true, attpath.Substring(attpath.LastIndexOf(".") + 1, 3));//添加附件
                jmmc.MailTemplate.Body = EmailMessage.Value.Trim();//邮件内容
                if (jmmc.MailTemplate.Send(webServer.Text.Trim(), false))
                {
                    Response.Write("<script>alert('发送成功')</script>");
                }
                else
                {
                    Response.Write("<script>alert('发送失败')</script>");
                }
                jmmc = null;

            }
        }

IT风云的主页 IT风云 | 初学一级 | 园豆:80
提问于:2010-08-11 18:51
< > 字节跳动旗下AI助手豆包
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册
Top