Sending Email Error with asp.net 2.0

Dear sirs/madam:

using asp.net 2.0 system.net.mail to send email on the server(not localhost).

 catch an exception(smtpException),and alert exception as follows:

ex.StatusCode:   GeneralFailure
ex.message:       The server committed a protocol violation The server response was:
ex.source:         System
ex.TargetSite:   Void CheckResponse(System.Net.Mail.SmtpStatusCode, System.String)

 

but the email can be sent !when i check up with the receiving email box,the email was sent successfully.

pls help me ,what is the mistake

thank you very much for your help.

0
worldnic
7/15/2006 12:20:26 PM
asp.net.getting-started 91979 articles. 3 followers. Follow

7 Replies
566 Views

Similar Articles

[PageSpeed] 12

It failed on getting the response, which is after the mail is sent.  See:

www.systemnetmail.com
www.systemwebmail.com

Jeff


Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
0
jeff
7/15/2006 6:45:35 PM

Dear Mr.Jeff:

thank you very much for your help.it run very well at LOCALHOST, but at Server(VS) the problem occoured.pls help me,how to do ? is it possible that the VS firewall or anti-virus system deny the smtp response?

hereuncer is the programmer:

 

Sub btnSubmit_Click(sender As Object, e As EventArgs)
    if userCheckingCode.pptCheckingCode<>0 then
    response.write("<script language='javascript'>alert('Error Checking Code')</script"+">")
    exit sub
    else

    dim  ML as new MailMessage()
    ML.From = new MailAddress(configurationSettings.appSettings("en_EmailFrom"),"service")
    ML.To.Add(Ctype(viewstate("en_email_to"),string))
    ML.Subject =txtSubject.text
    ML.IsBodyHtml="true"
    ML.Body ="<html>  "+txtEnquiry.text+"</html>"
    ML.BodyEncoding=System.Text.Encoding.UTF8
    ML.replyTo=New mailAddress(lblFrEmail.text)


    if CboxCopyToMyself.checked="true" then
    ML.cc.Add(lblFrEmail.text)
    end if


    if txtCopyTo.text<>"" then
    ML.cc.Add(txtCopyTo.text)
    end if


    ML.bcc.Add(configurationSettings.appSettings("en_EmailBcc"))
    dim MailSmtp as smtpClient=New smtpClient(configurationSettings.appSettings("en_emailSmtpServer"))
    mailSmtp.useDefaultCredentials="true"
 mailSmtp.Credentials =NEW NET.NETWORKCREDENTIAL(configurationSettings.appSettings("en_emailSendUserName"),configurationSettings.appSettings("en_emailSendPassword"))
 mailSmtp.timeOut=200000

 try
 mailSmtp.send(ML)
 panelSend.visible="false"
 panelSended.visible="true"    
 catch ex as smtpexception
 response.write("ex.StatusCode:")
 response.write(ex.StatusCode)
 response.write("<br>ex.message:")
 response.write(ex.message)
 response.write("<br>ex.source:")
 response.write(ex.source)
 response.write("<br>ex.TargetSite:")
 response.write(ex.TargetSite)
 end try
 end if    
 end sub

0
worldnic
7/16/2006 3:57:21 AM
worldnic:

thank you very much for your help.it run very well at LOCALHOST, but at Server(VS) the problem occoured.pls help me,how to do ? is it possible that the VS firewall or anti-virus system deny the smtp response?

It's possible.  But you could find out by disabling the firewall and AV software and testing.  Check the SMTP logs and see what the status code is.

Jeff


Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
0
jeff
7/16/2006 4:30:22 AM
the VS provider said they are not able to solve this problem, is it really a big problem?
0
worldnic
7/17/2006 5:41:05 AM

Hi,

My suggestion:

1. move your code to another server, better if you move it outside the firewall for testing, see if you can send out email

2. if you are lucky enough to have another email server, try pointing your smtp server setting to another server

3. could it be because you don't have enough right at the server? w2k3 ? check AD, also, from your webserver, try telnet to smtp service for your mail server, make sure smtp is running correctly.

Alan,

0
pc0416
7/17/2006 8:51:06 AM
thank to every one ,I have switch to another shared server,and now it run well.
0
worldnic
7/26/2006 9:58:21 AM
thank to every one ,I have switch to another shared server,and now it run well.
0
worldnic
7/26/2006 10:01:06 AM
Reply:

Similar Artilces:

Differences between .net 1, .net 1.1, .net 2.0 and .net 3.0 #2
Hi, This seems to be a common question, but i havent got an answer yet:(Can, any one please explain me the differences between these versions.If you keep your feet firmly on the ground, you'll have trouble putting on your pants! There are too many differences for one email - - from 1.0 to 1.1 (not a whole lot of real change, other than fixes, at least compared to 1.1 to 2.0) With 2.0, there were many new declarative controls, with many new ideas added in With 3.0, it's a superset of 2.0 - instead of replacing the installation completely, it just 'added on' new functionality - I would...

Differences between .net 1, .net 1.1, .net 2.0 and .net 3.0
Hi, This seems to be a common question, but i havent got an answer yet:(Can, any one please explain me the differences between these versions.If you keep your feet firmly on the ground, you'll have trouble putting on your pants! Have a look into this links http://en.wikipedia.org/wiki/.NET_Framework http://blogs.msdn.com/mohammadakif/archive/2006/12/03/net-3-0-different-versions-of-the-net-framework.aspx http://www.codeproject.com/aspnet/ComparisonASP1xASP20.aspAshok Rajawww.iGold.inDon't forget to click "Mark as Answer" on the post that helped you. This credits that m...

Error with using .Net 3.0 instead of .Net 2.0
Hi,  I have recently made a website in microsoft visual web developer 2005.  When I have uploaded my site to my host I am having trouble.  when I visit the page www.amcnewzealand.co.nz I get an error message.  My web hosting company does not support .net 3.0 but instead use .net 2.0.  My website is made with file extensions .aspx.  I am usure how to tell what version of .net I am using and wether this is the only cause.  At first there was a 403 error occuring. Help would be much appreciated as I have been struggling with this for some time. The version...

.Net 2.0 Web application using Vb.net is unable to create object of another dll writen in C# .net 2.0
Hi, I habe created one ASP.net web application using Vb.net which is adding reference of dlls written in C# and .net 2.0. But whenever trying to create object of referencing dll, it is throwing error :Object reference does not set to an object. But, locally it is working fine,. In the server i have deployed the .aspx files and dll files in the bin. There were already an web.config in the server which is of .net 1.1. But checked it is retrieving value for that web.config correctly. Should i have to deply any other files and if not what can be the solution for this? Please help. Thanks, So...

How to send email in net 2.0?
use system.net.mailneed username and password  kandy wrote:use system.net.mailneed username and passwordso you have the code to do it, but you need a username and password?-DarrenNeese.com-DNN ROCKS!-DeveloperSchool.com yes eg.  my email is  1638988@gmail.comthen the smtp server is  smtp.gmail.com  port 587 and username is  1638988 ,password is ******** hello. sorry, i don't understand what's wrong...what problem are you facing? can you give us more details? -- Regards,Luis Abreuemail: labreu_at_gmail.comEN blog:http://msmvps.com/blogs/luisabreu &nb...

Email cannot send by .net 2.0
Hi all,Could anybody help me how to send email by asp.net 2.0.My IIS server is sit on datacenter and all web site are set at there.Our IIS don't set for SMTP server, we use web mail service from others.For .net 1.1 projects all email functions are working and the new 2.0 project are can't send  by Real IIS server and even my localhost development machine also can't send email. but I can see those I use to send mail by 2.0 is stored in \inetpub\mailroot\Queue, i saw this. what happen and how to solved it.pls pls help me.thanks alot.  myoaung.sg:Hi all,Could anybody help me h...

.net 2.0
Hi,This is the error that I am getting when attempting to send an email via asp.net 2.0.Mailbox unavailable. The server response was: 5.7.1 Unable to relay for username@hpadsds.org.uk Any ideas please?THanks As the error suggests, did you enable relay on the mail server? The following site may help: SystemNetMail.com. HTH,RyanRyan OlshanASPInsider | Microsoft MVP, ASP.NEThttp://ryanolshan.comHow to ask a question The SMTP server needs to allow relaying for the web system, or possibly you need to authemticate to the server.  If this is your server, configure relaying.  If your...

Access .Net 2.0 Application from .Net 2.0 Web Site
I need to populate a specific form in a .Net desktop application from a .net web application.  Is there an easy way to go about this? Hi, Based on my understanding, you want to start an executable application from your ASP.NET websit, right? We can invoke Process.Start method (http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx) to launch an executable application from ASP.NET application. Note: Please keep in mind, the ASP.NET application is running on the server, so it will start the executable application that exists in the server.   I look...

Clickonce deployment anyone (DW.NET 2.0 and .NET 2.0)?
I saw someone had posted a question about this already, and there were no responses. So I am hoping that this will get some. We had problems with the previous version of DW.NET 1.5 + VS2003 when attempting to deploy applications via a web server. So many problems that we eventually decided to run off a network drive (which is OK if your user base doesn't roam around the country). Anyway, we gave up on DW.NET, and started to use the datagrid control. Since then, much has changed. Our development team now has VS2005 professional and may start using DW.NET 2.0 (pending my inv...

.NET 3.0 or .NET 2.0?
I'm going to move my exiting software to .net soon. I'm just wondering if I should wait for the .NET 3.0 framework to be released or if I can start with the 2.0 now? I'd say you can go ahead and move your code to .Net 2.0 as .Net 3.0 uses the CLR version 2.0.Basically, .net 3.0 is .net 2.0 PLUS some new features for presentation (GUI), communication and workflow process.  So the compiler as well as the language features used by the 2.0 runtime will be the same in 2.0 and 3.0"Never argue with an idiot; He will drag you down to his level and beat you with experienc...

.NET 2.0 Data Connection (.NET 2.0 Beta Data Provider)
I have installed the .NET 2.0 Beta Data Provider, in the server explorer in Visual Studio 2005 I have tried to connect to this provider but I can not see it in the list. Is there something else you need to do to see this other than what is in the instructions or is this not supported yet? Hi Dean, I assume you mean ASE ADO.NET 2.0 Beta. I'm attaching the html readme for this product that you should have from downloading it. Are you talking about using Server Explorer to see the Provider? This functionality isn't working yet and should be available on GA or shortly ...

Exception when sending emails in .NET 2.0
 Hi,I have a "Contact Us" form as follows:  Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Const Address As String = "myemail@hotmail.com" Dim objMM As New MailMessage(TextBox2.Text, Address) objMM.Subject = "Enquiry from website's 'Contact Us' form, submitted by " + TextBox1.Text objMM.Body = TextBox3.Text objMM.IsBodyHtml = False Dim smtp As New SmtpClient("localhost", 25) smtp.Send(objMM) End Sub I get...

Problem sending email with .net 2.0
I'm trying to send mail using the system.net.mail namespace. in the aspx file, I'm using a formview and inserting whatever is entered into a database also, then on the OnItemInserted event of the FormView, I'm trying to send the mail using the following. Can mail not be sent this way, or do you see something I could be missing?  Thanks, Rich  protected void FormContactUsFormView_Inserted(object sender, FormViewInsertedEventArgs e) { if (!Page.IsPostBack) { // send contact email //SmtpClient mySmtpClient = new SmtpClient(); ...

web.config problems when upgrading from .NET 2.0 Beta to .NET 2.0 release version
We uninstalled .NET 2.0 Beta and replaced it with .NET 2.0 release version.  And it messed everything up.  All applications now give weird errors indicating the lack of web.config files, despite the fact that they already have web.config files in place.  For example, the following error occurs even though the web.config file has <customErrors="Off">: Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for securit...

Converting classic to .NET 2 code, and .NET gets an error back from ADS?
 For future-proofing, our Internal Phone Directory is being moved onto our AD servers, and obviously we're using LDAP for queries.To get the phoneboook queries working, I adapted the current classic ASP code to use LDAP, and that works fine. However, we're wanting to move these pages to .NET, and that's where the problem comes in. Using the same basic logic from the Classic code (90% of its unchanged) to produce an LDAP query, I get the error  155 Unknown error (0x80005000)This is using the same website, and so the same credentials  - unless aspx pages run und...

Web resources about - Sending Email Error with asp.net 2.0 - asp.net.getting-started

Sending/receiving relationship - Wikipedia, the free encyclopedia
A sending/receiving relationship is one in which a public school district sends some or all of its students to attend the schools of another ...

U.K. Woman Faces 20 Months For Creating Fake Facebook Accounts, Sending Herself Abusive Messages
A woman in Cornwall in the U.K. came up with a creative way to use Facebook to accelerate a family spat, and it earned her 20 months in prison. ...

CHVRCHES - Dear guys, Please stop sending us emails like... - Facebook
Dear guys, Please stop sending us emails like this. This is one of the more polite ones. Other recent classics include "I'm going to give her ...

[...] Facebook Prevents Users From Sending Suspicious Friend Requests To Strangers, Inside Facebook [...] ...
Facebook has begun implementing new security measures to prevent friend request spamming. Some users are being shown a “This Request Can’t Be ...

A better experience for sending Tweets and DMs - Twitter Blog
... panel New Tweet panel in da...... Skip to main content Blog Got an account? Sign in Search form Search &nbsp A better experience for sending ...

How to Go From Working 60 Hours a Week to 40 By Sending 2 Emails a Week
I’m convinced 95% of cubicle workers who work over 60 hours a week constantly can cut it down to 40-45 hours by sending 2 emails a week to their ...

Emoticon and Emoji Box for iPhone -Save Emoticons,emoji,pic and images for Sending Message! 200 FREE ...
Get Emoticon and Emoji Box for iPhone -Save Emoticons,emoji,pic and images for Sending Message! 200 FREE emoticons and emojis - on the App Store. ...

Thanks for sending an iPhone4 and Sim T-Mobile but ... - Flickr - Photo Sharing!
... that's probably not going to work. (also, I'm sticking with the iPod touch).

Texas Man Makes $10K A Month Sending Potatoes With Personalized Messages In The Mail! - YouTube
Alex Craig, 24, said he came up with the idea for Potato Parcel earlier this year while having dinner with his girlfriend. His girlfriend called ...

'It was scary': widow speaks out as Muslim cleric pleads guilty to sending offensive letters to families ...
The young widow of fallen Australian soldier Brett Till still recalls the fear that came after she opened a letter sent to their home that labelled ...

Resources last updated: 12/25/2015 10:51:50 PM