Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to Send WebMail to Yahoo id

How to Send WebMail to Yahoo id

Scheduled Pinned Locked Moved ASP.NET
tutorialquestion
16 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Robymon
    wrote on last edited by
    #1

    Hi, How we can send webmail to Yahoo id. can i get some source code for this?.

    S G A S 4 Replies Last reply
    0
    • R Robymon

      Hi, How we can send webmail to Yahoo id. can i get some source code for this?.

      S Offline
      S Offline
      Satish_S
      wrote on last edited by
      #2

      hi i am not getting clear about your question, do you want to send mail to yahoo id

      R 1 Reply Last reply
      0
      • S Satish_S

        hi i am not getting clear about your question, do you want to send mail to yahoo id

        R Offline
        R Offline
        Robymon
        wrote on last edited by
        #3

        it is a contact us form. so users want to send mail to my yahoo id.

        1 Reply Last reply
        0
        • R Robymon

          Hi, How we can send webmail to Yahoo id. can i get some source code for this?.

          G Offline
          G Offline
          Gaurav K Singh
          wrote on last edited by
          #4

          use this function in vb.net Imports System.Net.Mail Public Function sendMails(ByVal toEmail As String, ByVal toName As String, ByVal fromEmail As String, ByVal fromName As String, ByVal subject As String, ByVal mailBody As String, ByVal host As String) As String Try Dim msg As MailMessage = New MailMessage msg.From = New MailAddress(fromEmail, fromName) msg.To.Add(New MailAddress(toEmail, toName)) 'msg.To.Add(new MailAddress("destination2@domain.com","Addressee 2's Name")); msg.Subject = subject msg.Body = mailBody msg.IsBodyHtml = True msg.Priority = MailPriority.High Dim c As SmtpClient = New SmtpClient("" & host & "") c.Send(msg) Return "Mail send successfully." Catch ex As Exception Return ("Send Email Failed.<br>" + ex.Message) End Try Return "Mail send successfully." End Function

          The miracle is this--the more we share, the more we have.

          R 1 Reply Last reply
          0
          • R Robymon

            Hi, How we can send webmail to Yahoo id. can i get some source code for this?.

            A Offline
            A Offline
            Abhijit Jana
            wrote on last edited by
            #5

            You have to use .NET Mail API, If you find, you will get lots of sample on that.

            cheers, Abhijit CodeProject MVP My Recent Article : Exploring Session in ASP.Net

            R 1 Reply Last reply
            0
            • G Gaurav K Singh

              use this function in vb.net Imports System.Net.Mail Public Function sendMails(ByVal toEmail As String, ByVal toName As String, ByVal fromEmail As String, ByVal fromName As String, ByVal subject As String, ByVal mailBody As String, ByVal host As String) As String Try Dim msg As MailMessage = New MailMessage msg.From = New MailAddress(fromEmail, fromName) msg.To.Add(New MailAddress(toEmail, toName)) 'msg.To.Add(new MailAddress("destination2@domain.com","Addressee 2's Name")); msg.Subject = subject msg.Body = mailBody msg.IsBodyHtml = True msg.Priority = MailPriority.High Dim c As SmtpClient = New SmtpClient("" & host & "") c.Send(msg) Return "Mail send successfully." Catch ex As Exception Return ("Send Email Failed.<br>" + ex.Message) End Try Return "Mail send successfully." End Function

              The miracle is this--the more we share, the more we have.

              R Offline
              R Offline
              Robymon
              wrote on last edited by
              #6

              I Used this and different code from google also. but am getting the following error.Should i do some setting changes or something in the email account? Send failure: System.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 216.239.59.109:587 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, GeneralAsyncDelegate asyncCallback) at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) --- End of inner exception stack trace --- at System.Net.Mail.SmtpClient.Send(MailMessage message) at Mail.btSend_Click(Object sender, EventArgs e) in e:\Uzhavoor_Project\Mail.aspx.cs:line 46

              G 1 Reply Last reply
              0
              • A Abhijit Jana

                You have to use .NET Mail API, If you find, you will get lots of sample on that.

                cheers, Abhijit CodeProject MVP My Recent Article : Exploring Session in ASP.Net

                R Offline
                R Offline
                Robymon
                wrote on last edited by
                #7

                I Used this and different code from google also. but am getting the following error.Should i do some setting changes or something in the email account? Send failure: System.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 216.239.59.109:587 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, GeneralAsyncDelegate asyncCallback) at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) --- End of inner exception stack trace --- at System.Net.Mail.SmtpClient.Send(MailMessage message) at Mail.btSend_Click(Object sender, EventArgs e) in e:\Uzhavoor_Project\Mail.aspx.cs:line 46

                R 1 Reply Last reply
                0
                • R Robymon

                  I Used this and different code from google also. but am getting the following error.Should i do some setting changes or something in the email account? Send failure: System.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 216.239.59.109:587 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, GeneralAsyncDelegate asyncCallback) at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) --- End of inner exception stack trace --- at System.Net.Mail.SmtpClient.Send(MailMessage message) at Mail.btSend_Click(Object sender, EventArgs e) in e:\Uzhavoor_Project\Mail.aspx.cs:line 46

                  G Offline
                  G Offline
                  Gaurav K Singh
                  wrote on last edited by
                  #8

                  First thing make clear, email cannot be send from localhost. If this error occurs form web then check the host id. Is is configured for SMTP mail.

                  The miracle is this--the more we share, the more we have.

                  R 1 Reply Last reply
                  0
                  • G Gaurav K Singh

                    First thing make clear, email cannot be send from localhost. If this error occurs form web then check the host id. Is is configured for SMTP mail.

                    The miracle is this--the more we share, the more we have.

                    R Offline
                    R Offline
                    Robymon
                    wrote on last edited by
                    #9

                    I used the following code for sending mail to my gmail id and i used the smtp server address also. i tried with different codes and different email smtp address also still getting the same error. MailMessage objEmail = new MailMessage(); objEmail.To = "someaddress@gmail.com"; objEmail.From = txtFrom.Text; objEmail.Subject = "Test Email"; objEmail.Body = txtName.Text + ", " + txtMessage.Text; objEmail.Priority = MailPriority.Normal; objEmail.BodyFormat = MailFormat.Text; SmtpMail.SmtpServer = "smtp.gmail.com"; try { SmtpMail.Send(objEmail); Response.Write("Your Email has been sent sucessfully - Thank You"); } catch (Exception exc) { Response.Write("Send failure: " + exc.ToString()); }

                    G 1 Reply Last reply
                    0
                    • R Robymon

                      I used the following code for sending mail to my gmail id and i used the smtp server address also. i tried with different codes and different email smtp address also still getting the same error. MailMessage objEmail = new MailMessage(); objEmail.To = "someaddress@gmail.com"; objEmail.From = txtFrom.Text; objEmail.Subject = "Test Email"; objEmail.Body = txtName.Text + ", " + txtMessage.Text; objEmail.Priority = MailPriority.Normal; objEmail.BodyFormat = MailFormat.Text; SmtpMail.SmtpServer = "smtp.gmail.com"; try { SmtpMail.Send(objEmail); Response.Write("Your Email has been sent sucessfully - Thank You"); } catch (Exception exc) { Response.Write("Send failure: " + exc.ToString()); }

                      G Offline
                      G Offline
                      Gaurav K Singh
                      wrote on last edited by
                      #10

                      You cannot use smtp.gmail.com or smtp.yahoo.com like this. Because these server are will rejuct your request for mail send. If you purchase any web domain and if that domain is smtp enabled for you, then only you can send mail.

                      The miracle is this--the more we share, the more we have.

                      R 1 Reply Last reply
                      0
                      • R Robymon

                        Hi, How we can send webmail to Yahoo id. can i get some source code for this?.

                        S Offline
                        S Offline
                        Sujith C Jose
                        wrote on last edited by
                        #11

                        May be this will help you get a better idea ... http://randomcodingtips.blogspot.com/2008/06/send-email-using-cnet-visual-studio.html[^]

                        Sujith My Blog

                        R 1 Reply Last reply
                        0
                        • G Gaurav K Singh

                          You cannot use smtp.gmail.com or smtp.yahoo.com like this. Because these server are will rejuct your request for mail send. If you purchase any web domain and if that domain is smtp enabled for you, then only you can send mail.

                          The miracle is this--the more we share, the more we have.

                          R Offline
                          R Offline
                          Robymon
                          wrote on last edited by
                          #12

                          How could we know that whether that mail server is smtp enabled or not. Or Can we enable from our code.

                          G 1 Reply Last reply
                          0
                          • S Sujith C Jose

                            May be this will help you get a better idea ... http://randomcodingtips.blogspot.com/2008/06/send-email-using-cnet-visual-studio.html[^]

                            Sujith My Blog

                            R Offline
                            R Offline
                            Robymon
                            wrote on last edited by
                            #13

                            i tried with this code also but am getting the same error

                            1 Reply Last reply
                            0
                            • R Robymon

                              How could we know that whether that mail server is smtp enabled or not. Or Can we enable from our code.

                              G Offline
                              G Offline
                              Gaurav K Singh
                              wrote on last edited by
                              #14

                              No, You cannot enable server for smtp from your code due to security reason. As i know, none of the service provider gives us this facility to enable from code. You can do it by using their admin panel.

                              The miracle is this--the more we share, the more we have.

                              R 1 Reply Last reply
                              0
                              • G Gaurav K Singh

                                No, You cannot enable server for smtp from your code due to security reason. As i know, none of the service provider gives us this facility to enable from code. You can do it by using their admin panel.

                                The miracle is this--the more we share, the more we have.

                                R Offline
                                R Offline
                                Robymon
                                wrote on last edited by
                                #15

                                Ok. Thanks. I found some codes from the google sending mails to Gmail and yahoo, how we can do that.

                                1 Reply Last reply
                                0
                                • R Robymon

                                  I Used this and different code from google also. but am getting the following error.Should i do some setting changes or something in the email account? Send failure: System.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 216.239.59.109:587 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, GeneralAsyncDelegate asyncCallback) at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) --- End of inner exception stack trace --- at System.Net.Mail.SmtpClient.Send(MailMessage message) at Mail.btSend_Click(Object sender, EventArgs e) in e:\Uzhavoor_Project\Mail.aspx.cs:line 46

                                  R Offline
                                  R Offline
                                  ritzy pal
                                  wrote on last edited by
                                  #16

                                  Try again with same code, but send emails on Gmail account and not yahoo. If you get error , post it again.

                                  1 Reply Last reply
                                  0
                                  Reply
                                  • Reply as topic
                                  Log in to reply
                                  • Oldest to Newest
                                  • Newest to Oldest
                                  • Most Votes


                                  • Login

                                  • Don't have an account? Register

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • World
                                  • Users
                                  • Groups