How do you send mail using exchange server from a asp.net page??
Could not find any examples on that,
Using smtp i could achieve this but don't know how to do using exchange server.
I am using the foll code for sending mail using outlook objects and it gives me this error:
Private Sub SendMail()
Dim s As String
Dim objOutlook As Outlook._Application = New Outlook.ApplicationClass()
Dim objFolder As Outlook._NameSpace = objOutlook.GetNamespace("MAPI"
Dim objMail As Outlook._MailItem = objOutlook.CreateItem(OlItemType.olMailItem)
objMail.To = txtTo.SelectedItem.Value
objMail.From = txtFrom.SelectedItem.Value
objMail.Subject = txtSubject.Text
objMail.Body = txtMessage.Text
objMail.Send()
objOutlook.Quit()
End Sub
Error:
--------
Access is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access is denied.
The ASP.NET process is not authorized to access the requested resource. For security reasons the default ASP.NET process identity is '{machinename}\ASPNET', which has limited privileges. Consider granting access rights to the resource to the ASP.NET process identity.
To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the "{machinename}\ASPNET" user. Highlight the ASP.NET account, and check the Write box in the Allow column.
I have done exactly the way it is mentd. above but doesn't help me.
I am also having a problem with email using ASP.net and wondered if the two are related. We have Exchange 2000 with relaying blocked. When an internet user presses a submit button, code on our server side prints a delivery ticket and emails customer service with the request. I also want it to email an "on-call" cell phone during closed hours. This causes the following error:
The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for someone@somewhere.net
I am using code similar to member Zarcon's FAQ 796-2119.
Could relay blocking be at the root of your problem? Does anybody have a workaround for this?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.