• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 177
  • Last Modified:

ASP and MAPI

How can I send email through MS-Exchange in ASP ?

What is the problem in the following code ?

Set objSession=Server.CreateObject("MAPI.Session")
objSession.Logon "Profile Name", "password", False, True, 0, False, "mailserver" & chr(10) & "andrew.yu"
Set objMessage = objSession.Outbox.Messages.Add
objMessage.Subject="Subject"
objMessage.Text="Body"
Set objonerecip=objmessage.Recipients.Add
objonerecip.Name="someone@testserver.com"
objMessage.Send
objSession.Logoff

Andrew
0
andrewyu
Asked:
andrewyu
  • 2
1 Solution
 
nikhilhCommented:
<%
Sub email_to
      Set objMail = CreateObject("CDONTS.Newmail")
      objMail.From = "Me(me@testserver.com)"
      objMail.To = "myaddress@testserver.com"
      objMail.Subject = "Test Mail"
      objMail.Body = "Hi"
      objMail.Send
      Set objMail = Nothing%>

Try using this kind of script
0
 
andrewyuAuthor Commented:
Does this procedure need anymore extra setting, like specify the SMTP or exchange server ?

Andrew
0
 
andrewyuAuthor Commented:
By the way, can anyone tell me what is the problem in the ASP segment ?

Andrew
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now