That is amazing how easy it is to fix any problem as soon as it gets to the status of the ex-problem. After I found the way to make my email work on GoDaddy with their Form Mailer, I took another look at SMTP and sure enough all peaces readily fall into place. Here is step-by-step instruction on how to setup and use SMTP with GoDaddy – the way God intended.


1. Get GoDaddy’s email account. I believe it comes with any domain registration or hosting package for free. Do not use external POP account (Google, Yahoo, Hotmail etc.). They all require SSL and custom port and you’ll get nothing but trouble. So sign up for internal GoDaddy mail account, your SMTP server will be smtp.secureserver.net (or whatever they assign you). The reason SMTP did not work for me is exactly that – it was blocked by firewall on my hosting server. So, let’s say you have domain “smith.com” with GoDaddy. When you create email account you will set user name and password, let’s say it is “john” and “password”. And your server is “smtp.secureserver.net”. This is how you create your client then:

2. In your code, create message - the usual way:

using System.Net.Mail;
    
MailMessage message = new MailMessage();
message.From = newMailAddress("me@us.com");
message.To.Add(new MailAddress("you@them.com"));
message.Subject = "test";
message.Body = "This is test";

3. Set up client and send message:

SmtpClient smtp = new SmtpClient("smtp.secureserver.net");
smtp.Credentials = new System.Net.NetworkCredential("john","password");
smtp.Port = 25;
smtp.EnableSsl = false;
smtp.Send(message);

Pretty easy - ones you understand why your message is not getting to smtp.gmail.com with SSL on through the port 465 (583, 995…). Because they all closed!

Signature

Related posts

Comments

10/12/2007 5:31:25 AM

I use different host and it does not provide me email account - not for free at least as far as I know. Do you know any smtp providers that let you go through standard port 25? I seriously doubted my host will drill hole in the firewall for gmail, even if I ask nicely Frown

Stephan

10/12/2007 7:13:13 AM

It all depends on host you are using, as far as I know some wont let you use port 25 either – but they will give you mail account you can use instead. I suggest you ask your host before looking for alternatives.

rtur.net

1/14/2008 4:56:33 PM

I have found inside godaddy a most usefull and reliable method to send mail, it uses CDOSYS and works perfectly, the address is

http://help.godaddy.com/article.php?article_id=1073&topic_id=

this is the code that I have tried, using VB.

Sub Sendmail()
Dim message As New MailMessage
message.From = "acortes@***.com"
message.To = "acortes@***.com"
message.Subject = "Contact us"
message.BodyFormat = MailFormat.Html
message.Priority = MailPriority.High
message.Body = "This is a Test!!!"
SmtpMail.SmtpServer = "relay-hosting.secureserver.net"
SmtpMail.Send(message)
End Sub

And it worked flawlessly.

Thank You.

Carlos Andres Cortes

1/14/2008 4:59:15 PM

Almost forgot, you must use the namespace System.Web.Mail instead of System.Net.Mail which is most updated but doesn't work or at leats doesn't work for me.

on VB

Imports System.Web.Mail

Carlos Andres Cortes

3/17/2008 2:04:05 PM

For BE users, this is what my mail settings look like:
http://farm3.static.flickr.com/2093/2340810385_c0903b31e8.jpg?v=0

rtur.net

4/28/2008 11:10:13 AM

Hi I have a godaddy hosting with IIS 6 and asp.Net 2.0/3.0/3.5 and i can t get the system.net.mail code to work, the code works perfectly locally, I get mail instantly. But once its up on the server it crashes. code as follows:

private void SendMail(string from, string body)
{
MailMessage message = new MailMessage(from, "info@mypage.com", "Web Mail", body);
SmtpClient mailClient = new SmtpClient();
//Set SMTP Server and Credentials
mailClient.Host = "smtpout.secureserver.net";
mailClient.Credentials = new System.Net.NetworkCredential("info@mypagecom", "password");
//set Port and SSL
mailClient.Port = 25;
mailClient.EnableSsl = false;
//Send message
mailClient.Send(message);
message.Dispose();
Response.Redirect("thanks.html");
}


Any help would be appreciated.

Nat

Add comment


 

  Country flag

biuquoteimg
Loading



<<  May 2008  >>
SuMoTuWeThFrSa
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567
Enhanced with Snapshots

Subscribe to Rtur.net