Solved

smtp, asp.net, godaddy

Posted on 2013-06-12
3
220 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 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

7 Experts available now in Live!

Get 1:1 Help Now