Solved

smtp, asp.net, godaddy

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

831 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