asp.net托管站点问题 [英] asp.net hosted site problem

查看:59
本文介绍了asp.net托管站点问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的项目中有邮件和寻呼机消息发送问题,但这仅是在我访问托管站点时出现的.


当我调试Visual Studio项目时,它运行正常.

请提供您宝贵的反馈意见


你有什么建议吗?



问候,
Shefek

Hi,

I have a mail and pager message sending problem in my project but it is only when i access the hosted site.


When i debug the project form visual studio it is working perfectly.

Please provide your valuable feedback


DO you have any suggestion.



regards,
Shefek

推荐答案

希望此链接会有所帮助.

配置SMTP电子邮件(IIS 7) [ ^ ]

Hope this link helps.

Configure SMTP E-mail (IIS 7)[^]

报价:

1.启动->管理工具->服务器管理器,转到功能,选择添加功能",勾选"smtp服务器"(如果尚未安装),选择安装所需的远程服务器管理员". >
2.检查并确认简单邮件传输协议(SMTP)"服务正在运行,如果可以,我们很好.

3.启动->管理工具>互联网信息服务(iis)6.0

4.确保SMTP虚拟服务器/默认的smtp服务器正在运行,如果没有,请右键单击,然后选择启动"

5.在IIS7中,转到网站/虚拟目录,双击"SMTP电子邮件",单击将电子邮件传递到SMTP服务器",选中使用本地主机"复选标记

6.您的代码应为:

SmtpClient serv = new SmtpClient();
MailMessage msg = new MailMessage();
msg.To.Add("toadrr@domain.com);
msg.Body ="body";
msg.Subject ="subj";
msg.BodyEncoding = System.Text.Encoding.ASCII;
msg.IsBodyHtml = isHTML;
serv.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
serv.Credentials =新的NetworkCredential(ConfigurationManager.AppSettings ["SmtpServerUserName"],ConfigurationManager.AppSettings ["SmtpServerPassword"]);
serv.Send(msg);



--->我的应用程序现在正在发送电子邮件.第一封电子邮件在Queue文件夹中花费了大约30分钟,但是此后,每封电子邮件都会立即发送. (这是出于测试目的,我不确定是否应该在生产环境中使用此设置-请告知)

1. start->administrative tools->server manager, go to features, select "add features", tick "smtp server" (if it is not already installed), choose to install the required "remote server admin toos"

2. check to confirm that "Simple Mail Transfer Protocol (SMTP)" service is running, if so, we are good to go.

3. start->administrative tools>internet info services(iis) 6.0

4. make sure that SMTP virtual server/default smtp server is running, if not, right click, then choose "start"

5. in IIS7, go to website/virtual directory, double click "SMTP E-mail", Click on "Deliver e-mail to SMTP server", check the "Use localhost" checkmark

6.Your code should be LIKE:

SmtpClient serv = new SmtpClient();
MailMessage msg = new MailMessage();
msg.To.Add("toadrr@domain.com);
msg.Body = "body";
msg.Subject = "subj";
msg.BodyEncoding = System.Text.Encoding.ASCII;
msg.IsBodyHtml = isHTML;
serv.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
serv.Credentials = new NetworkCredential(ConfigurationManager.AppSettings["SmtpServerUserName"], ConfigurationManager.AppSettings["SmtpServerPassword"]);
serv.Send(msg);



--->My app is now sending emails. The first email spent about 30 min in the Queue folder, but after that, each email is sent straight away. (this is working for testing purposes, i am not sure if i should use this setup in a production environment - please advise)


这篇关于asp.net托管站点问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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