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. Problem in sending e-mail through code in asp.net2.0 ?

Problem in sending e-mail through code in asp.net2.0 ?

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netcomsysadminbeta-testing
7 Posts 4 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.
  • S Offline
    S Offline
    Subin Alex
    wrote on last edited by
    #1

    Hi, When i try to send email using the following code : MailMessage objEmail = new MailMessage(); objEmail.To = "feedback@yendha.com"; objEmail.From = "subinalex007@gmail.com"; objEmail.Subject = "Feed Back to www.yendha.com"; objEmail.Body = txt_feed.Text; try { SmtpMail.SmtpServer = "smtp.yendha.com"; SmtpMail.Send(objEmail); Response.Write("Your Email has been sent sucessfully to "); } catch (Exception exc) { Response.Write("Send failure: " + exc.ToString()); } An Exception is raised i.e, "The server rejected one or more recipient addresses. The server response was: 554 5.7.1 subinalex007@gmail.com: Sender address rejected: Access denied\r\n"

    M S J 3 Replies Last reply
    0
    • S Subin Alex

      Hi, When i try to send email using the following code : MailMessage objEmail = new MailMessage(); objEmail.To = "feedback@yendha.com"; objEmail.From = "subinalex007@gmail.com"; objEmail.Subject = "Feed Back to www.yendha.com"; objEmail.Body = txt_feed.Text; try { SmtpMail.SmtpServer = "smtp.yendha.com"; SmtpMail.Send(objEmail); Response.Write("Your Email has been sent sucessfully to "); } catch (Exception exc) { Response.Write("Send failure: " + exc.ToString()); } An Exception is raised i.e, "The server rejected one or more recipient addresses. The server response was: 554 5.7.1 subinalex007@gmail.com: Sender address rejected: Access denied\r\n"

      M Offline
      M Offline
      Manas Bhardwaj
      wrote on last edited by
      #2

      Subin Alex wrote:

      The server rejected one or more recipient addresses. The server response was: 554 5.7.1 : Sender address rejected: Access denied\r\n"

      The SMTP Security policies are not allowing you to use gmail address for sending the mail.

      Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

      1 Reply Last reply
      0
      • S Subin Alex

        Hi, When i try to send email using the following code : MailMessage objEmail = new MailMessage(); objEmail.To = "feedback@yendha.com"; objEmail.From = "subinalex007@gmail.com"; objEmail.Subject = "Feed Back to www.yendha.com"; objEmail.Body = txt_feed.Text; try { SmtpMail.SmtpServer = "smtp.yendha.com"; SmtpMail.Send(objEmail); Response.Write("Your Email has been sent sucessfully to "); } catch (Exception exc) { Response.Write("Send failure: " + exc.ToString()); } An Exception is raised i.e, "The server rejected one or more recipient addresses. The server response was: 554 5.7.1 subinalex007@gmail.com: Sender address rejected: Access denied\r\n"

        S Offline
        S Offline
        Sundeep Ganiga
        wrote on last edited by
        #3

        Try This class to send mail. System.Net.Mail.SmtpClient() Regards, SG

        Give a man a fish and you feed him for a day. Teach a man to fish and you feed him forever.

        S 1 Reply Last reply
        0
        • S Subin Alex

          Hi, When i try to send email using the following code : MailMessage objEmail = new MailMessage(); objEmail.To = "feedback@yendha.com"; objEmail.From = "subinalex007@gmail.com"; objEmail.Subject = "Feed Back to www.yendha.com"; objEmail.Body = txt_feed.Text; try { SmtpMail.SmtpServer = "smtp.yendha.com"; SmtpMail.Send(objEmail); Response.Write("Your Email has been sent sucessfully to "); } catch (Exception exc) { Response.Write("Send failure: " + exc.ToString()); } An Exception is raised i.e, "The server rejected one or more recipient addresses. The server response was: 554 5.7.1 subinalex007@gmail.com: Sender address rejected: Access denied\r\n"

          J Offline
          J Offline
          J4amieC
          wrote on last edited by
          #4

          MAny SMTP servers restrict the sender to a local domain. That means if the SMTP Server is expecting all senders to be from 'somedomain.com' for example. Using your gmail address as the From address will cause the server to refuse to send mail.

          S 1 Reply Last reply
          0
          • S Sundeep Ganiga

            Try This class to send mail. System.Net.Mail.SmtpClient() Regards, SG

            Give a man a fish and you feed him for a day. Teach a man to fish and you feed him forever.

            S Offline
            S Offline
            Subin Alex
            wrote on last edited by
            #5

            Hi, I tried it, but it returned the err "Sending Failure" Plz help.

            S 1 Reply Last reply
            0
            • J J4amieC

              MAny SMTP servers restrict the sender to a local domain. That means if the SMTP Server is expecting all senders to be from 'somedomain.com' for example. Using your gmail address as the From address will cause the server to refuse to send mail.

              S Offline
              S Offline
              Subin Alex
              wrote on last edited by
              #6

              Hi, It is not a local domain , but Remote

              1 Reply Last reply
              0
              • S Subin Alex

                Hi, I tried it, but it returned the err "Sending Failure" Plz help.

                S Offline
                S Offline
                Sundeep Ganiga
                wrote on last edited by
                #7

                Hi Subin, This Should Work.If Not Your Mail server is blocking somewhere. Dim mSmtpClient As New System.Net.Mail.SmtpClient() mSmtpClient.Host = "You Mail server name" //smtp.yendha.com mSmtpClient.Port = "Port Being used Of your mail server" mSmtpClient.Send(oMailMsg)

                Give a man a fish and you feed him for a day. Teach a man to fish and you feed him forever.

                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