Solved

asp.net, email, godaddy

Posted on 2013-06-06
2
534 Views
Last Modified: 2013-06-07
I need to send email by using GoDaddy.com hosting. and have two questions.

1. The following code does not work emailing. any idea why?
2. If the following codes are resided my house server(window 2008), will the smtp email still working? Or the codes have to reside in godaddy hosting?

thanks

  public static string SendEmail(string from, string to, string subject, string body)
        {
            try
            {
                MailMessage MessageInfo = new MailMessage(from,to,subject,body);
                MessageInfo.IsBodyHtml = true;
                SmtpClient EmailClient = new SmtpClient("relay-hosting.secureserver.net");
                System.Net.NetworkCredential SMTPUserInfo = new System.Net.NetworkCredential("smtp01@test.com", "pwd");
                EmailClient.UseDefaultCredentials = false;
                EmailClient.Credentials = SMTPUserInfo;
                EmailClient.Send(MessageInfo);
                return "Send";
                //smtp01@evidiabio.com
                //Success@1368
            }
            catch
            {
                return "Unable to send email";
            }
        }
0
Comment
Question by:solution1368
  • 2
2 Comments
 
LVL 33

Accepted Solution

by:
paulmacd earned 500 total points
Comment Utility
You're in a TRY...CATCH - what's the error message being returned?  Use...
     catch (Exception e)
...to get the exception.
0
 
LVL 33

Expert Comment

by:paulmacd
Comment Utility
Thanks for the points.  I hope you were able to resolve your problem!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now