Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8253993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:03:57+00:00 2026-06-08T01:03:57+00:00

I´m trying to send an email through gmail using this code: MailMessage msg =

  • 0

I´m trying to send an email through gmail using this code:

MailMessage msg = new MailMessage();
            msg.From = new MailAddress("admin@XXXXXX.com");
            msg.To.Add(destinos);
            msg.Subject = "XXXX";
            msg.Body = "XXXX"
            //msg.Attachments.Add(new Attachment(archivo + ".pdf"));
            //msg.Attachments.Add(new Attachment(archivo + ".xml"));
            SmtpClient client = new SmtpClient("smtp.google.com", 587);//587 465 
            client.EnableSsl = true;
            client.DeliveryMethod = SmtpDeliveryMethod.Network;
            client.Credentials = new System.Net.NetworkCredential("admin@XXXX.com", pass);

                client.Send(msg);

However it fails, giving this exception:

16/07/2012 03:45 p.m. ERROR: Error al enviar correo. Data: System.Collections.ListDictionaryInternal System.Net.WebException: No se puede resolver el nombre remoto: 'smtp.google.com'
   en System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout)
   en System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback)
   en System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback)
   en System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout)
   en System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint)
   en System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint)
   en System.Net.Mail.SmtpClient.GetConnection()
   en System.Net.Mail.SmtpClient.Send(MailMessage message) Exception actual: Void Send(System.Net.Mail.MailMessage)

The exception is in spanish, I don’t really like that either but it says something like:

There was an error when sending the mail, Couldn't resolve host smtp.google.com

I have checked the current google parameters and they look good for this code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T01:03:58+00:00Added an answer on June 8, 2026 at 1:03 am

    Please see the ifnromation below taken from google and looks like you got smtp host wrong
    http://support.google.com/mail/bin/answer.py?hl=en&answer=13287

    Configure your client to match the settings below:
    Incoming Mail (POP3) Server - requires SSL: pop.gmail.com
    Use SSL: Yes
    Port: 995
    Outgoing Mail (SMTP) Server - requires TLS3 
        or SSL: smtp.gmail.com (use authentication)
    Use Authentication: Yes
    Port for TLS/STARTTLS: 587
    Port for SSL: 465
    Account Name:   your full email address (including @gmail.com or @your_domain.com)
    Email Address:  your email address (username@gmail.com or username@your_domain.com)
    Password:   your Gmail password
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to send an smtp email through gmail's smtp server using the
Well I'm trying to send a HTML email using gmail smtp from CI, and
I am trying to send an email (through gmail) using python script that someone
I am trying to send email through gmail using PHPMailer_V5.1. Getting the following error,
Possible Duplicate: Sending email in .NET through Gmail I am trying to send a
I am trying to send email using smtp authentication through google but I am
I am trying to send email using Exchange 2007 from a console app using
I am trying to send email using c# following is my code. try {
I'm trying to send an email via some C# ASP.NET code. This is being
I am trying to send an email using the following very standard code. However,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.