.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

using smtp in Gmail with ASP.net

Posted By:      Posted Date: October 03, 2010    Points: 0   Category :ASP.Net

hello all i using this code to send an mail msg from gmail account but this error appear to me The Error ==================================================================================================== TestNot SendSystem.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) --- End of inner exception stack trace --- at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) at System.Net.PooledStream.Activate(Object owningObject, General

View Complete Post

More Related Resource Links

I cannot send mail using gmail smtp server


 Here is my code

Dim message As System.Net.Mail.MailMessage = New System.Net.Mail.MailMessage()
        message.To.Add("from textbox field")
        message.Subject = "Testing"
        message.From = New System.Net.Mail.MailAddress("sender email ")
        message.Body = "Just Testing"

        Dim smtp As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient()

        Dim client As SmtpClient = New SmtpClient()
        smtp.Credentials = New System.Net.NetworkCredential("username", "password")
        smtp.Port = 25
        smtp.Host = "smtp.gmail.com"
        smtp.EnableSsl = True
        smtp.DeliveryMethod = SmtpDeliveryMethod.Network
        lblmsg.Text = "Your Email has send"


Using Gmail as SMTP Server for SSRS

Folks, check the internet, so far not getting to far on using smtp.gmail.com as smtp server. I want  to sent Subscription email using gmail smtp server, but keep getting Failure sending mail: The transport failed to connect to the server. What can I do ? Setup--- SSRS 2008 R2 Windows Server 2008 R2

Using Google SMTP server (smtp.gmail.com) when configuring subscriptions unders SSRS 2008

Hello All, I have read thru numerous posts and have reviewed several links with no luck.  I am trying to use gmail smtp servers (smtp.gmail.com) to configure SSRS 2008 to send email.  It's running on Server 2003 Standard SP2. No Exchange server, we use gmail. Error message I receive is "Failure sending mail: The report server has encountered a configuration error. Mail will not be resent." Here is a copy of my RS Email Config: <Configuration> <RSEmailDPConfiguration> <SMTPServer>smtp.gmail.com</SMTPServer> <SMTPServerPort></SMTPServerPort> <SMTPAccountName></SMTPAccountName> <SMTPConnectionTimeout> </SMTPConnectionTimeout> <SMTPServerPickupDirectory> </SMTPServerPickupDirectory> <SMTPUseSSL></SMTPUseSSL> <SendUsing>2</SendUsing> <SMTPAuthenticate></SMTPAuthenticate> <From>myemailaddress@gmail.com</From> <EmbeddedRenderFormats> <RenderingExtension>MHTML</RenderingExtension> </EmbeddedRenderFormats> <PrivilegedUserRenderFormats> </PrivilegedUserRenderFormats> <ExcludedRenderFormats> <RenderingExtension>HTMLOWC</RenderingExtension> <RenderingExtension>NULL</RenderingExtension> <RenderingExtension>RGDI</RenderingExtension> </ExcludedRenderFormats> <SendEmai

Using Google SMTP server (smtp.gmail.com) when configuring subscriptions unders SSRS 2008

Hello All, I have read thru numerous posts and have reviewed several links with no luck.  I am trying to use gmail smtp servers (smtp.gmail.com) to configure SSRS 2008 to send email.  It's running on Server 2003 Standard SP2. No Exchange server, we use gmail. Error message I receive is "Failure sending mail: The report server has encountered a configuration error. Mail will not be resent." Here is a copy of my RS Email Config: <Configuration> <RSEmailDPConfiguration> <SMTPServer>smtp.gmail.com</SMTPServer> <SMTPServerPort></SMTPServerPort> <SMTPAccountName></SMTPAccountName> <SMTPConnectionTimeout> </SMTPConnectionTimeout> <SMTPServerPickupDirectory> </SMTPServerPickupDirectory> <SMTPUseSSL></SMTPUseSSL> <SendUsing>2</SendUsing> <SMTPAuthenticate></SMTPAuthenticate> <From>myemailaddress@gmail.com</From> <EmbeddedRenderFormats> <RenderingExtension>MHTML</RenderingExtension> </EmbeddedRenderFormats> <PrivilegedUserRenderFormats> </PrivilegedUserRenderFormats> <ExcludedRenderFormats> <RenderingExtension>HTMLOWC</RenderingExtension> <RenderingExtension>NULL</RenderingExtension> <RenderingExtension>RGDI</RenderingExtension> </ExcludedRenderFormats> <SendEmai

What will be the correct smtp settings for sending out email from an asp.net website to gmail's bus

Hi,I have setup a gmail's business account for my company.Now I want to receive all the emails like ContactUs, Qoute Email, etc from my website to that account i.e. info@mydomainname.com I have added the following smtp settings behind my web formsSmtpClient smtpClient = new SmtpClient("localhost",25); //Providing Network credentials smtpClient.Credentials = new System.Net.NetworkCredential("quote@mydomainname.com", "password"); smtpClient.UseDefaultCredentials = true; smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network; MailMessage mail = new MailMessage(); //HTML Mail Format mail.IsBodyHtml = false; //Setting Form , To and CC mail.From = new MailAddress("quote@mydomainname.com", "My Web Site"); mail.To.Add(new MailAddress("info@mydomainname.com")); This code gives me feedback "email has successful sent"  but it does not send any email to info@mydomainname.comCan anyone let me know what will be the correct smtp settings for sending out emails to gmail's business accounts?Regards,Dazy

Sending email via SmtpClient() not working with smtp.gmail.com :(

Help I cannot seem to send an email via my gmail account using "C#" why not?   <system.net> <mailSettings> <smtp deliveryMethod="Network" from="ian.coetzer@gmail.com"> <network host="smtp.gmail.com" port="587" enableSsl ="true" defaultCredentials ="false" password ="xxxxxx" userName ="ian.coetzer@gmail.com"></network> </smtp> </mailSettings> </system.net> SmtpClient smtpClient = new SmtpClient(); MailMessage message = new MailMessage(); try { message.To.Add(emailTo); message.Subject = ""; message.Body = GetEmailBody(userName, password, url); smtpClient.Send(message); return true; } catch(Exception ex) { throw new ApplicationException("Could not send notification.", ex); }   I.W Coetzer

How to configure Gmail SMTP server to send mail



I'm using forgot password wizard and I configure my smtp like this:

and the SMTP server:

smtp.gmail.com (use authentication)
Use Authentication: Yes
Use STARTTLS: Yes (some clients call this SSL)
Port: 465 or 587

   <smtp from="myemail@gmail.com">
    <network host="smtp.gmail.com" password="pass" port="587"
     userName=myemail@gmail.com />

 but, the error:

The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. 23sm5887003pzk.8

Please gives me some advices,

Thank you.

Using WCF Service to Email with smtp.gmail


I am using silverlight 4 and I have implemented a WCF service to email my gmail account through the app.

My smtp.Send(msg) line is failing and sending it into the catch statement.

I'm not sure where the problem is but posted below is my code for the WCF service method it is failing in.

public bool SendMail(string emailTo, string emailFrom, string msgSubject, string msgBody)
            bool success = false;
                MailMessage msg = new MailMessage();

Gmail internal chat like message box

This article provides you with the multi-functional message box window through which the usability of the web-site or any web application increases.

.Configurable MessageBox window with AJAX Support
.can set maximum number of message boxes to be visible
.can define the auto reload time, for single message, for all messages or no reload
.can create messages through a single function call
.can define auto hide time for each messages

Gmail style multiple Sign-in type combo...is it possible in asp.net?


I am developing a multi-company application and want my users to give the functionality like the following to switch companies.


Is this possible? then how?

Please help


SMTP not working if I use web deployment package to deploy my app.


Hi all

I use msdeploy to install my web app. deployment package. everything about web app works, but find out email was not working.

I checked telnet smtp is running.

I debug the project, and it was sending out email too.

So my solution was upload the whole project (not complied) to wwwroot, and email works too. Thats why I assume the deployment cause the problem.

at last, I also tried to copy the web deployment web.config to replace the project's web.config, and the email also work, so it wasn't the web.config problem.

Could anyone tell me whats going on?

My environment:

window 2003

iis 6

.net framework 4.0

send email using Godaddy server by gmail


 Hello ,


My site is hosted  in Godaddy server. And i am using google apps for emailing a/c for that i have changed the  MX-records and then it is working fine.

Then i finished my web site


it is working fine there .

in the site there is a  contactus link which opens


this page basically should send a mail to a particular email id .

for sending mail I am using gmail a/c . (Here is the full code)


public void SendEmail(string From,string GmailEmail, string GmailPassword, string To, string Subject, string Body,      
        FileUpload fileupload)

        System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
        mail.From = new MailAddress(From, "One Ghost", System.Text.Encoding.UTF8);
        mail.Subject = Subject;
        mail.SubjectEncoding = System.Text.Encoding.UTF8;

smtp server 5.1 in xp not sending emails


hi iam using asp.net 2.0 with c#.net.

in my application when client completes its shopping email will goes to user this works fine when there is internet connection is working fine,
if  there is some problem  in internet connection if one mail stops then all the mails will be stopped even now internet works fine,

how to resend the emails using smtp server, is there any option to resend the emails automatically when internet works fine.

can you give example which helps me.

how to create gmail type login?



For my project, i have designed a login page like gmail.

According to the  credentials given by the  users the application should send to the corresponding pages asigned to them.

Please give me the answer.

Thanks in advance.

how to import contacts from yahoo, gmail, etc using C#.NET 1.1

i want to import contacts from gmail, yahoo etc when you give the username and password like in sites like hi5 and myspace. how do i do this?? i use visual studio 2003.

smtp is noe sending email instantly,it makes a Queue in my local system

I am using a  smtp to send email from asp.net (C#)code.it sending some email instantly but many of email is making a queue in my Inetpub folder at local system.what could be the issue ? please help me to get rid from it.ThankxArvind

Automating Gmail Account Creation

I tried to remove some unnecessary thing like styles but the HTML is still lengthyBelow is the source of: https://www.google.com/accounts/NewAccount?service=mail<html> <head> <title>Google Accounts</title> </head> <body onLoad="return(doKtInit());" > <script type="text/javascript"> var KT_keydownHandler,KT_keypressHandler,KT_logEncoder,KT_lastElement=-1,KT_lastKeyCode=-1,KT_lastModifiers=-1,KT_logElement=0,KT_stoppedLog,KT_ALLOW_FIELD_TYPES={password:1,text:1},KT_ALLOW_FIELD_IDS={firstname:1,lastname:1,email:1,passwd:1,passwdagain:1,identityanswer:1,secondaryemail:1,newaccountcaptcha:1,nickname:1},KT_lastTime,KT_inputs,KT_keyInputs=[];if(window.captureEvents){Event.KEYPRESS&&window.captureEvents(Event.KEYPRESS);Event.KEYDOWN&&window.captureEvents(Event.KEYDOWN)} function KT_preSubmit(){if(KT_logEncoder){if(KT_keydownHandler){KT_encode(16);KT_initHandlers(KT_inputs)}var a=KT_logEncoder;if(a.d!=0){EN_encodeGroup(a,a.p);a.p=0}}}function KT_encode(a){a<0?KT_stopLog():EN_encode(KT_logEncoder,a)}function KT_init(a,c,d){a=KT_logElement=a;if(!a.value)a.value="A";KT_logEncoder={e:a,p:0,d:0};KT_initHandlers(d);c=c;if(!c.value)for(d=1;d<KT_keyInputs.length;d++)c.value+=KT_keyInputs[d].name+" "} function KT_event(a,c){if(KT_logElement.value.length>3E3){KT_encode(17);KT_stopLog
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend