Solved

smtp, asp.net, godaddy

Posted on 2013-06-12
3
222 Views
Last Modified: 2013-06-18
I have web hosting on goDaddy.com
and now I want to put the following codes
into another hosting server which is not in godaddy.com
Will the SMTP still work?


  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", 25);
                System.Net.NetworkCredential SMTPUserInfo = new System.Net.NetworkCredential("smtp01@xxx.com", "xxx");
                EmailClient.UseDefaultCredentials = false;
                EmailClient.Credentials = SMTPUserInfo;
                EmailClient.Send(MessageInfo);
                return "Send";
            }
            catch (Exception e)
            {
                return "Unable to send email<br>" + e.ToString() + "<br>";
            }
        }
0
Comment
Question by:solution1368
  • 2
3 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39242976
No, it will only work in the GoDaddy environment.
You will have to set up your own mail server or use a generic one like GMail.
0
 

Author Comment

by:solution1368
ID: 39243002
hmmm.. okay.
assume I have my own server, 173.111.111.1111
and I want to code reside on 173.111.111.1112. Will the SMTP still work?

SmtpClient EmailClient = new SmtpClient(173.111.111.1111, 25);
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39243014
Not sure I understand what you mean
Normally you do not open mail servers to allow relaying - allows the possibility of your mail server being used to send spam..
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

896 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

11 Experts available now in Live!

Get 1:1 Help Now