Myself and another ASP.NET member, Jonathan, are both having trouble with Gmail not working.
Also, I had a code that WAS working, and it worked several times. When Jonathan posted his problem, I went and tried it again--to no avail.
Jonathan and I will be working to solve this, and I predict it will mean our using a different Email host--you are invited to our endeavor.
I'll get back here and reply with the work you asked for in your question--I thought you would want to know though that the failure of the godaddy STMP was in no way an indication of an error in your code.
This answers your first question but I suspect your end goal is to successfully send email using ASP.NET.
Are you working with C# or VB? I'm a C# guy but I'm learning more and more VB (for just in case) and so I'd like to continue this with you and Jonathan until we can declare victory.
""Mailbox unavailable. The server response was: DY-001 Mail rejected by Windows Live Hotmail for policy reasons. We generally do not accept email from dynamic IP's as they are not typically used to deliver unauthenticated SMTP e-mail to an Internet mail
server. http://www.spamhaus.org maintains lists of dynamic and residential IP addresses. If you are not an email/network admin please contact your E-mail/Internet Service Provider for help. Email/network admins, please
visit""
i got the above error message when i changing the server name but i wonder why it cant work? i create according to the video that provide in asp.net
I don't think you did anything wrong. The way the message reads it is a "sorry, I can't do that" rather than something like "syntax error", "code error", etc.
1. Does the code you are using have you give an account name and password? I noticed the word "unauthenticated" used in the message you got that started with "Mailbox unavailable."
The code i'm using i had given my gmail account name but i dont think i given the passwords, however i'm using the VB code which learnt from the asp.net video. btw i really dunno where to insert passwords.
The two posts that follow this one will include the front page (aspx) and the code behind page (aspx.vb) for sending a simple email. I tried it this morning before posting the code.
We can continue dialogue after that to discuss any questions.
System.Net.Mail
Partial Class VBMail1
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender
As Object,
ByVal e As System.EventArgs)
Handles Button1.Click
Dim Mail As
New System.Net.Mail.MailMessage()
With Mail
.To.Add(
"somebody@somewhere.com")
.From = New Net.Mail.MailAddress("yourgmailaccountname@gmail.com")
.Subject = SubjectTextBox.Text
.Body = BodyTextBox.Text
End With
Dim SMTP
As New Net.Mail.SmtpClient("smtp.gmail.com")SMTP.Credentials
= New System.Net.NetworkCredential("yourgmailaccountname@gmail.com",
"yourpasswordhere")
I'm assuming any person coming to this example is fairly new, and there are some things that I want to make sure you take note of them:
Notice the "Imports" statement at the top of the code behind page. When I started out, I had a problem with trying to reproduce the example in a tutorial and they had forgotten to mention that necessary Import statements.
Notice that the subroutine has a "Handles Button1.Click" and that the button on the front page has ID="Handles Button1.Click".
Notice that the text in TextBoxes on the front page can be brought into variables by writing the ID of the TextBox then period then Text.
loon86
Member
7 Points
57 Posts
Hotmail or Gmail Server name to be insert into feedback form?
Mar 16, 2008 02:47 PM|LINK
Hi, may i know what is the email server name for hotmail and gmail.
i had inserted smtp.gmail.com but my page cant work but i don't know why?
ldechent
Contributor
6326 Points
1577 Posts
Re: Hotmail or Gmail Server name to be insert into feedback form?
Mar 16, 2008 05:00 PM|LINK
Myself and another ASP.NET member, Jonathan, are both having trouble with Gmail not working.
Also, I had a code that WAS working, and it worked several times. When Jonathan posted his problem, I went and tried it again--to no avail.
Jonathan and I will be working to solve this, and I predict it will mean our using a different Email host--you are invited to our endeavor.
I'll get back here and reply with the work you asked for in your question--I thought you would want to know though that the failure of the godaddy STMP was in no way an indication of an error in your code.
Best regards,
-Larry
ldechent
Contributor
6326 Points
1577 Posts
Re: Hotmail or Gmail Server name to be insert into feedback form?
Mar 16, 2008 05:05 PM|LINK
The email in the next line lists a bunch of SMTP servers.
http://www.e-eeasy.com/SMTPServerList.aspx
This answers your first question but I suspect your end goal is to successfully send email using ASP.NET.
Are you working with C# or VB? I'm a C# guy but I'm learning more and more VB (for just in case) and so I'd like to continue this with you and Jonathan until we can declare victory.
-Larry
loon86
Member
7 Points
57 Posts
Re: Hotmail or Gmail Server name to be insert into feedback form?
Mar 16, 2008 05:44 PM|LINK
""Mailbox unavailable. The server response was: DY-001 Mail rejected by Windows Live Hotmail for policy reasons. We generally do not accept email from dynamic IP's as they are not typically used to deliver unauthenticated SMTP e-mail to an Internet mail server. http://www.spamhaus.org maintains lists of dynamic and residential IP addresses. If you are not an email/network admin please contact your E-mail/Internet Service Provider for help. Email/network admins, please visit""
i got the above error message when i changing the server name but i wonder why it cant work? i create according to the video that provide in asp.net
ldechent
Contributor
6326 Points
1577 Posts
Re: Hotmail or Gmail Server name to be insert into feedback form?
Mar 16, 2008 07:07 PM|LINK
I don't think you did anything wrong. The way the message reads it is a "sorry, I can't do that" rather than something like "syntax error", "code error", etc.
I'm going to look into this this now. My reference will be http://weblogs.asp.net/scottgu/archive/2005/12/10/432854.aspx and I have two questions for you:
1. Does the code you are using have you give an account name and password? I noticed the word "unauthenticated" used in the message you got that started with "Mailbox unavailable."
2. Are you using C# or VB?
-Larry
loon86
Member
7 Points
57 Posts
Re: Hotmail or Gmail Server name to be insert into feedback form?
Mar 17, 2008 02:57 AM|LINK
The code i'm using i had given my gmail account name but i dont think i given the passwords, however i'm using the VB code which learnt from the asp.net video. btw i really dunno where to insert passwords.
ldechent
Contributor
6326 Points
1577 Posts
Example code is coming
Mar 21, 2008 12:26 PM|LINK
The two posts that follow this one will include the front page (aspx) and the code behind page (aspx.vb) for sending a simple email. I tried it this morning before posting the code.
We can continue dialogue after that to discuss any questions.
-Larry
ldechent
Contributor
6326 Points
1577 Posts
VBMail1.aspx
Mar 21, 2008 12:28 PM|LINK
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="VBMail1.aspx.vb" Inherits="VBMail1" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>Gmail from VBMail1</title> </head> <body> <form id="form1" runat="server"> <div> Subject:<br /> <asp:TextBox ID="SubjectTextBox" runat="server" Width="400px"></asp:TextBox> <br /><br /> Body:<br /> <asp:TextBox ID="BodyTextBox" runat="server" Height="200px" Width="400px" TextMode="MultiLine"></asp:TextBox> <br /><br /> <asp:Button ID="Button1" runat="server" Text="Push to send the email" /></div> <br /><br /> <div id="messageline" runat="server">Text will disappear from the box after the email is sent...</div> </form> </body> </html>ldechent
Contributor
6326 Points
1577 Posts
VBMail1.aspx.vb
Mar 21, 2008 12:30 PM|LINK
Imports
System.Net.Mail Partial Class VBMail1 Inherits System.Web.UI.Page Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim Mail As New System.Net.Mail.MailMessage() With Mail.To.Add(
"somebody@somewhere.com") .From = New Net.Mail.MailAddress("yourgmailaccountname@gmail.com").Subject = SubjectTextBox.Text
.Body = BodyTextBox.Text
End With Dim SMTP As New Net.Mail.SmtpClient("smtp.gmail.com")SMTP.Credentials = New System.Net.NetworkCredential("yourgmailaccountname@gmail.com", "yourpasswordhere")SMTP.Port = 587
SMTP.Host =
"smtp.gmail.com"SMTP.EnableSsl =
TrueSMTP.Send(Mail)
SMTP =
NothingMail.Dispose()
BodyTextBox.Text =
""SubjectTextBox.Text =
""messageline.InnerHtml =
"" End SubEnd
Classldechent
Contributor
6326 Points
1577 Posts
About the Example, VBMail1
Mar 21, 2008 12:41 PM|LINK
I'm assuming any person coming to this example is fairly new, and there are some things that I want to make sure you take note of them:
Notice the "Imports" statement at the top of the code behind page. When I started out, I had a problem with trying to reproduce the example in a tutorial and they had forgotten to mention that necessary Import statements.
Notice that the subroutine has a "Handles Button1.Click" and that the button on the front page has ID="Handles Button1.Click".
Notice that the text in TextBoxes on the front page can be brought into variables by writing the ID of the TextBox then period then Text.
-Larry