We help IT Professionals succeed at work.

Use asp classic to send form email through Exchange 2007

974 Views
Last Modified: 2010-04-21
Experts, I had previously been using ASPEmail from Persits to use ASP classic to send email.  I purchased and installed the full version on my web server.  Here is the site:  http://www.aspemail.com/

Once I upgraded to Exchange 2007, my web forms will not mail anything anymore.  I have edited the code to use the proper user name and password, and changed the host name to the new server.  Tried both IP address and computer name, but nothing is sending.  Is Exchange 2007 blocking me for some reason?  Are there settings I need to change?

The web server is the same computer, and I am hoping to either continue using aspemail or if somebody could provide me with an alternative, that would be great.
'Here is a sample of one of our forms.  There is more involved, but this is the meat of it
 
 <%
	  On Error Resume Next
	  Dim errorLev
	  errorLev = "0"
	  Dim fname, email, comments, subject
	  'Get the Form Data
	  If Request.Form.Count=0 Then
	  errorLev="1"
	  Else
	   email = Request.Form("email")
	   fname = Request.Form("name")
	   comments = Request.Form("comments")
	  End If
	  
	  'Add Our Data
	  subject = "Comment Submission website"
 
	  'Make the E-Mail
	  Dim mainString: mainString = "From: "&fname&vbCrLf&"E-Mail Address: "&email&vbCrLf&vbCrLf&"Comments: "&comments
 
	  'Send the E-Mail
	  If errorLev = "0" Then
 	   Dim mailObj
 
	   Set mailObj = Server.CreateObject("Persits.MailSender")
	   mailObj.Host = "servernamehere"
	   mailObj.AddAddress "myemail@mydomain.com"
	   mailObj.From = email
	   mailObj.FromName = fname
	   mailObj.Subject = subject
	   mailObj.Body = mainString
	   mailObj.IsHTML = False
 
	    mailObj.Username = "user"
	   mailObj.Password = "password"
	   mailObj.Send
	   If Err <> 0 Then
	    errorLev = "2"
	   End If
	  End If

Open in new window

Comment
Watch Question

Top Expert 2008

Commented:
Hi,

what are you using for "servernamehere" in mailObj.Host?

normally, if it is on the same server, you would use "localhost"{ or "127.0.0.1"

when you try sending, do you see any errors?  check exchange logs (smtp service) as well as event viewer.

Cheers.

Author

Commented:
We have found an answer to the problem.  If we elevated our "user" in active directory to "Domain Admin" status, Exchange 2007 allowed the mail to send out.  I don't know if this is the best thing, we have a generic account for handling our email forms that I would prefer not be any level of admin account.  However another person suggested this from another website forum and it definitely worked.  Perhaps it is simply a permissions issue on the ASPemail DLL, and the user needs full rights to that install in order to function.  I will leave this question open I guess for some debate, but then close it.  Let me know if anybody has any thoughts.
Top Expert 2008
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Permissions to the DLL appears to be the answer, although I cannot fully verify that at this time.  However, it is the most likely solution.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.