Click here to Skip to main content
15,035,600 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Updated 29-Jul-11 2:37am
v2

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,

C#
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";
                }

thanks
pavan
   
v2
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?
   
Comments
Soft009 3-Aug-11 6:49am
   
Nice said............
Take a look at this Code Project Q/A. Best way, to send large volumes of emails?[^]
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900