Unable to send email from my website

Discussion in 'Email' started by msoumare, Apr 1, 2008.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Yes [email protected] is a valid email address. If you want you can send a test email to that address. It will go through
     
  2. Imports DataTier


    Imports System.Text


    Imports System.Net.Mail


    Public Class CPSInitialNotification


    Public Sub Process(ByVal pobjProcessor As COrderProcessor)


    Dim lobjSmtpClient As New SmtpClient


    Dim lobjNotification As MailMessage = New MailMessage("contactus@ys-electronics", "[email protected]", "Order Received.", "Test")


    lobjSmtpClient.Host = "smtp.ys-electronics.com"


    lobjSmtpClient.Port = 587


    lobjSmtpClient.Send(lobjNotification)


    End Sub
    End Class


    ============================================Error Message=====================================================




    {System.Net.Mail.SmtpFailedRecipientException}


    System.Net.Mail.SmtpFailedRecipientException: {"Mailbox unavailable. The server response was: <[email protected]> No such user here"}


    Data: {System.Collections.ListDictionaryInternal}


    HelpLink: Nothing


    InnerException: Nothing


    Message: "Mailbox unavailable. The server response was: <[email protected]> No such user here"


    Source: "System"


    StackTrace: " at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException&amp; exception)


    at System.Net.Mail.SmtpClient.Send(MailMessage message)


    at BusinessTier.CPSInitialNotification.Process(COrderProcessor pobjProcessor) in C:\Documents and Settings\Mohamed Soumare\My Documents\Visual Studio 2005\Projects\YSElectronics\BusinessTier\CPSInitialNotification.vb:line 35"


    TargetSite: {System.Reflection.RuntimeMethodInfo}
     
  3. I changed the SMTP server to use localhost, but still the error message is here. The email could not be sent. I really don't know what the problem is. Do I have to authenticate on the server when sending email?
     
  4. You're not running this code locally, correct?
     
  5. Try using localhost as Host.
    btw, looks like your DataTier is referencing a local data object.
     
  6. Can you verify that '[email protected]' is a valid and active email address? The error message is pretty clear...

    'Mailbox unavailable. The server response was: <[email protected]> No such user here'

    If this web application is hosted on a discountasp web server, try using 'localhost' as the smtp server. This tells the web application to use the web servers smtp service.

    rcp
    DiscountASP.NET
    www.DiscountASP.NET
     
  7. Change this to use localhost instead of your domain:


    lobjSmtpClient.Host = "smtp.ys-electronics.com"


    lobjSmtpClient.Port = 587
    ...You can also try port 25
     
  8. I have uploaded the code in discountasp.net servers. This is the part that sends the email. I tried both SMTP. localhost and smtp.ys-electronics.com neither one worked.









    Imports DataTier


    Imports System.Text


    Imports System.Net.Mail


    Public Class CPSInitialNotification


    Public Sub Process()


    Dim lobjSmtpClient As New SmtpClient


    Dim lobjNotification As MailMessage = New MailMessage("contactus@ys-electronics", "[email protected]", "Order Received.", "Test")


    lobjSmtpClient.Host = "smtp.ys-electronics.com"


    lobjSmtpClient.Port = 587


    lobjSmtpClient.Send(lobjNotification)


    End Sub
    End Class
     
  9. I tried both ports 25 and 587 also both SMTP servers localhost and smtp.ys-electronics.com: I got the same error message "Unable to connect to the remote server".


    I don't know what's wrong. Please help me, it's really urgent.





    Imports DataTier


    Imports System.Text


    Imports System.Net.Mail


    Public Class CPSInitialNotification


    Public Sub Process()


    Dim lobjSmtpClient As New SmtpClient


    Dim lobjNotification As MailMessage = New MailMessage("contactus@ys-electronics", "[email protected]", "Order Received.", "Test")


    lobjSmtpClient.Host = "localhost"


    lobjSmtpClient.Port = 25


    lobjSmtpClient.Send(lobjNotification)


    End Sub
    End Class
     
  10. It gets harder to catch these things but I just noticed you seem to be mixing SMTP code from 1.1 and 2.0

    Do you simply need a Contact page for ASP.NET 2.0 ?
    I can post one for you if so.
    Salute,
    Mark
     
  11. I'm using .NET 2.0. I want to be able to send an email confirmation to the user after he/she purchases a product. That's all I need. Help me please.
     
  12. Something simple like this will work, just add your paramerters to it:

     
  13. It works like a charm.

    I appreciate all your effort and willingness to help. I will recommend this company to all my collegues and business partners for your great support. This is what we need a company like yours in the web hosting business.

    Thanks again
     
  14. Could you tell me the SMTP Code for a 1.1 ?
     
  15. To be honest I'm trying to forget, too confusing keeping these things straight in my head. [​IMG]
    You can however find some 1.1 examples with my Microsoft Search Engine:http://search.live.com/macros/wisemx/aspnet/
    Salute,
    Mark
     
  16. Bruce

    Bruce DiscountASP.NET Staff

  17. I am experiencing exact;y the same issue! Does anyone know of the C# syntax used for this?

    thank you thank you!!

    Holly
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page