通过使用c#.net的asp.net发送邮件 [英] send a mail by using asp.net using c#.net

查看:57
本文介绍了通过使用c#.net的asp.net发送邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用于发送邮件的代码.我的网站托管在服务器上,但托管后无法正常工作.请给我一个答案. 很紧急

在此先感谢

I have a code for sending a mail. My website is hosted on server but it is not working when i hosted.Please give me a answer. Its urgent

Thanks in Advance

推荐答案

这里有一个通用的工作程序: ^ ]
There is a generic, working routine here: Sending an Email in C# with or without attachments: generic routine.[^]


遵循这些代码非常容易

复制过去的申请,

its very easy to follow these code

copy past your application,

string htmlBody = strBuilder.ToString();
                SmtpClient smtp;
                System.Net.NetworkCredential basicAuth;
                mail.Body = htmlBody.ToString();
                smtp = new SmtpClient();
                basicAuth = new System.Net.NetworkCredential("info@shreyastechsolutions.com", "shreyas2011");
                smtp.Host = "mail.shreyastechsolutions.com";
                smtp.UseDefaultCredentials = false;
                smtp.Credentials = basicAuth;
                try
                {
                    smtp.Send(mail);
                    lblWarning.Text = "Email Sent successfully";
                }
                catch (SmtpException ex)
                {
                    lblWarning.Text = "Email Sent Failed";
                }


谢谢
pavan


thanks
pavan


我在blablabla银行有一个帐户.但是,当我检查余额时,看不到其中的一百万美元.请给我答案.紧急.

这句话看起来和您的问题类似吗?
您如何认为任何人都会在不看您的代码或任何错误详细信息的情况下进行猜测?
I have an account with blablabla bank. But when I check the balance, I do not see million dollar in it. Please give me answer. It is urgent.

Does this statement look similar to your question?
How do you suppose that anyone would guess without looking at you code or any error details?


这篇关于通过使用c#.net的asp.net发送邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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