CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

YesSoftware Forums -> CodeCharge Studio -> .NET

 ASP.NET - Error in sending Email from Google Apps

Print topic Send  topic

Author Message

Posts: 1
Posted: 05/20/2015, 1:52 AM

I want to send EMail from my Website hosted at, and we are using Google Apps for Emails. Here is my code in ASP.Net/ C#,
MailMessage mMailMessage = new MailMessage();
mMailMessage.From = new MailAddress("", "GotFeedback", System.Text.Encoding.UTF8);
mMailMessage.To.Add(new MailAddress(""));
mMailMessage.Subject = "subject";
mMailMessage.SubjectEncoding = System.Text.Encoding.UTF8;
mMailMessage.Body = body;
mMailMessage.BodyEncoding = System.Text.Encoding.UTF8;
mMailMessage.IsBodyHtml = true;
mMailMessage.Priority = MailPriority.Normal;

SmtpClient mSmtpClient = new SmtpClient();
mSmtpClient.UseDefaultCredentials = false;
mSmtpClient.Credentials = new System.Net.NetworkCredential("", "mypassword");
mSmtpClient.Host = "SMTP.GOOGLE.COM";
mSmtpClient.Port = 587;
mSmtpClient.EnableSsl = true;
catch(Exception e)
string edsf = e.ToString();

But I am getting Exception that it is unable to connect to remote server :( Please help. Thanks!
View profile  Send private message

Posts: 513
Posted: 05/20/2015, 5:46 AM


Not specific to CodeCharge, but there are a number of things that might be getting in the way:

- network firewall settings not allowing SMTP traffic on port 587

- smtp server address - I've seen references to '' as well ( )

- the port - sometimes 587 doesn't work for some SSL and 465 is needed

- have you activated SMTP Relay for your google apps account? ( )

Can you post the exact error message?


CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia
View profile  Send private message

Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

Web Database

Join thousands of Web developers who build Web applications with minimal coding.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by  and YesSoftware, Inc.