What about the port?
I'm using gmail for bussines and my smtp port is 465.

What happen if you try to POP auth before the smtp?

HTH

Claudio M. E. Bastos Iorio

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Ross
Sent: Monday, November 21, 2011 5:26 PM
To: DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web
Services,.NET Remoting
Subject: [DotNetDevelopment] GMail for Business

I've been using the following snippet for a while now to send email via
Google's SMTP server:

SmtpClient smtp = new SmtpClient
            {
                Host = "smtp.gmail.com",
                Port = 587,
                EnableSsl = true,
                DeliveryMethod = SmtpDeliveryMethod.Network,
                UseDefaultCredentials = false,
                Credentials = new
NetworkCredential(fromAddress.Address, fromPassword)
                //Credentials = new
NetworkCredential(fromAddress.Address, fromPassword)
            };

            using (MailMessage message = new MailMessage(fromAddress,
toAddress) { Subject = subject, Body = body })
            {
                smtp.Send(message);
            }

Works great for regular GMail addresses.  However, if I swap the "from"
credentials to a GMail for business client, I start getting the following
exception:

System.Net.Mail.SmtpException: The SMTP server requires a secure connection
or the client was not authenticated. The server response
was: 5.5.1 Authentication Required. Learn more at

And no, that message isn't truncated.  That's all it gives me.

In my naive mind, GMail and GMail for Business ought to use the same SMTP
gateway.  My question is, is that assumption valid?  Is the setup different
for the business version?  Is there something (hopefully) simple I'm
missing?

Thanks in advance,
Ross

--
You received this message because you are subscribed to the Google Groups
"DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web
Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net

-- 
You received this message because you are subscribed to the Google
Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
Web Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net

Reply via email to