Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send Mail

Status
Not open for further replies.

ami7

Programmer
Oct 3, 2002
48
GB
Hi all,

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.

pls help.
Thanks
ami.
 
Doesn't your exchange server have an address? Just use the smtp mail classes, and specify the address of your exchange server to send the mail.
penny1.gif
penny1.gif

The answer to getting answered -- faq855-2992
 
Hi,

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.

Pls help.
Thanks,
ami.
 
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?
 
Hi,

I could resolve the above error by setting the identity attribute in the web.config file.

<identity impersonation=&quot;true&quot; userName=&quot;domain\username password=&quot;password&quot;>

It works.

Hope this helps.

Rgds,
ami.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top