Solved

smtp, asp.net, godaddy

Posted on 2013-06-12
3
227 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

726 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