Send mail using Godaddy C#

C Sharp - C# (programming language)
Post Reply
dzcadii
Posts: 94
Joined: Sun Mar 01, 2015 4:36 am

Send mail using Godaddy C#

Post by dzcadii » Sun Mar 01, 2015 10:51 pm

Code: Select all

try
            {
                MailMessage message = new MailMessage();
                message.To.Add("email@adress.com");
                message.Subject = "Mail test from local machine";
                message.From = new System.Net.Mail.MailAddress("your@emailaddress.com");
                message.Body = "Did it send?";
                SmtpClient smtp = new SmtpClient();                
                smtp.Host = "smtpout.secureserver.net";
                smtp.Port = 80;
                smtp.Credentials = new System.Net.NetworkCredential("your@emailaddress.com", "Password");
                smtp.EnableSsl = false;
                smtp.Send(message);
            }
            catch(SmtpException exc)
            {
                return false;
            }

            return true;

Post Reply