?
Solved

smtp, asp.net, godaddy

Posted on 2013-06-12
3
Medium Priority
?
229 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

800 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