邮件未从ftp网站触发! [英] Mail not firing from ftp site !!

查看:73
本文介绍了邮件未从ftp网站触发!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在类文件中编写了以下代码,该文件应该从ftp站点触发邮件(该站点之前已触发),但是现在它已经停止了,请提出一些解决方案.代码如下:

****************************************************** ***************

I have the following code written in a class file which is suppose to fire a mail from the ftp site (which it was firing earlier) but now it has stopped so kindly suggest some solution. Code is as under:

*****************************************************************

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections;
using System.Web.Mail;
using System.Data.SqlClient;
using System.Reflection;
using ASPEMAILLib;

/// <summary>
/// Summary description for CompMail
/// </summary>

public class CompMail
{
    public CompMail()
    {
        //
        // TODO: Add constructor logic here
        //
    }

    public void fireMail(int comp_seqid)
    {
        MailMessage mailMsg = new MailMessage();
        mailMsg.To = "tanind@gmail.com";
        mailMsg.From = "Manage-a-company.com";
        mailMsg.Subject = "Hi! Test Mail";
        mailMsg.Body = "Hello this is a test mail" + comp_seqid.ToString();
        mailMsg.BodyFormat = MailFormat.Text;

        SmtpMail.SmtpServer = "localhost";
        SmtpMail.Send(mailMsg);
    }
}



请帮我解决这个问题.我还在文件中添加了ASPEMAILLib.dll及其参考.仍然无法使用.

预先感谢,

Indrajeet



Please help me out of this problem. I have also added ASPEMAILLib.dll and its reference in the file. Still not working.

Thanks in advance,

Indrajeet

推荐答案

可能是由于各种原因.您需要一一看待它们.
港口开放吗?防火墙权限到位了吗?
进一步确保已在Web.Config中配置SMTP配置:
It can be because of various reasons. You need to look at them one by one.
Is the port open? Firewall permissions in place?
Further make sure you have configured SMTP configuration in Web.Config:
<system.net>
   <mailSettings>
     <smtp from="abc@somedomain.com">
       <network host="somesmtpserver" port="25" userName="name" password="pass" defaultCredentials="true" />
     </smtp>
   </mailSettings>
</system.net>


如果需要,请查看此Microsoft Video教程:
使用ASP.NET发送来自网站的电子邮件 [


If needed, have a look at this Microsoft Video tutorial:
Use ASP.NET to send Email from Website[^]
If needed, there are lots of article on this very site on how to send emails.


这篇关于邮件未从ftp网站触发!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆