MENACESKINZ
New Member
Not sure if this question has been asked elsewhere... For a website project that I'm working on, I created an ASPX web form that will send an email containing the contents of the form on button click. I tried it and it worked when I'm using the Yahoo SMTP server and testing using my personal Yahoo email address (+ specifying the username and password). However, it wouldn't work when I'm using the SMTP server for mail messages for the website (after I've created a new admin email account in the website). The website is up and running and I'm able to send an email to the website's admin email account (through Yahoo) but just not when sending through the ASPX web form.Here is the code for using the Yahoo SMTP server and it works fine:\[code\] SmtpServer.Credentials = New Net.NetworkCredential("[email protected]", "password") SmtpServer.Port = "25" SmtpServer.Host = "smtp.mail.yahoo.com" mail.From = New MailAddress("[email protected]") mail.To.Add("[email protected]") mail.Subject = "RE: Message Subject" mail.Body = "Message goes here." SmtpServer.Send(mail)\[/code\]Now, here is the code for using my website's SMTP server which doesn't work:\[code\] SmtpServer.Port = "25" SmtpServer.Host = "127.0.0.1" mail.From = New MailAddress("[email protected]") mail.To.Add("[email protected]") mail.Subject = "RE: Message Subject" mail.Body = "Message goes here." SmtpServer.Send(mail)\[/code\]These are the correct port and host numbers given by the web hosting company that hosts the website. They also said that username and password are not needed. I also tried appending this to the beginning of the code but it still wouldn't work:\[code\] SmtpServer.Credentials = New Net.NetworkCredential()\[/code\]or even\[code\] SmtpServer.Credentials = New Net.NetworkCredential("", "")\[/code\]I really don't know what to do. Please help this newbie out. Any response is appreciated.By the way, the error message that I get when I test this out appears in a message box: "Failure sending mail."