Active Server Pages

Moderators: None (Apply to moderate this forum)
Number of threads: 1763
Number of posts: 4498

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
ASP Mail Posted by litter on 29 Dec 2004 at 3:55 AM
below is my asp code for send mail through the form, but when i testing,only the last line of code working that is redirect. can anyone help me to check any error?

<%
' Declare Variables
Dim objNewMail, strFilePath

' Create Instance of NewMail Object
Set objNewMail = Server.CreateObject("CDONTS.NewMail")
' Set Email Priority (1 = Normal)
objNewMail.Importance = 1
' Send plain text email
objNewMail.BodyFormat = 1
' Senders email address
objNewMail.From = request.querystring("name")
' Recipients email address
objNewMail.To = "techsupport@allit.com.my"
' Email Subject
objNewMail.Subject = "enquiry"
' Email Body
objNewMail.Body = request.querystring("enquiry")
' Send Email
objNewMail.Send()
' Destroy object to release it from memory
Set objNewMail = Nothing

response.Redirect("thankyou.htm")
%>
Report
Re: ASP Mail Posted by Flakes on 29 Dec 2004 at 4:01 AM
: below is my asp code for send mail through the form, but when i testing,only the last line of code working that is redirect. can anyone help me to check any error?
:
: <%
: ' Declare Variables
: Dim objNewMail, strFilePath
:
: ' Create Instance of NewMail Object
: Set objNewMail = Server.CreateObject("CDONTS.NewMail")
: ' Set Email Priority (1 = Normal)
: objNewMail.Importance = 1
: ' Send plain text email
: objNewMail.BodyFormat = 1
: ' Senders email address
: objNewMail.From = request.querystring("name")
: ' Recipients email address
: objNewMail.To = "techsupport@allit.com.my"
: ' Email Subject
: objNewMail.Subject = "enquiry"
: ' Email Body
: objNewMail.Body = request.querystring("enquiry")
: ' Send Email
: objNewMail.Send()
: ' Destroy object to release it from memory
: Set objNewMail = Nothing
:
: response.Redirect("thankyou.htm")
: %>
:


Check your mailroot folder to see whther the mail is going to any of the folders(drop/queue/badmail etc.) inside mailroot.

Also ,the from mailid has to be a valid one.


Report
Re: ASP Mail Posted by litter on 29 Dec 2004 at 1:12 PM

i had check, is no error over this. is there any other method to send mail with form ?
Report
Re: ASP Mail Posted by Flakes on 29 Dec 2004 at 9:42 PM
:
: i had check, is no error over this. is there any other method to send mail with form ?
:


yes there are some free components,which you have to install in your system.ASPMail,I think is there,do a google for it.

Your code should have worked,dont know why it doesnt.maybe there is something wrong with the configurations...

If you are using XP,you have to use CDO.Message instead of CDONTS.Newmail..


Report
Re: ASP Mail Posted by litter on 30 Dec 2004 at 12:53 AM
this is not my machine, i am remote to my hosting. i dont know what OS of the machine. Maybe can u try to go there and check?
www.allit.com.my/test/wwwroot/customer.asp
Report
Re: ASP Mail Posted by Flakes on 30 Dec 2004 at 10:53 PM
: this is not my machine, i am remote to my hosting. i dont know what OS of the machine. Maybe can u try to go there and check?
: www.allit.com.my/test/wwwroot/customer.asp
:


Then you could ask the hosting company why this is happening and if there are other options available.

You do have a mailid called techsupport@allit.com.my ??


Report
Re: ASP Mail Posted by litter on 31 Dec 2004 at 3:21 AM
yes i have.
Thanks for helping, i received your testing email already
Report
Re: ASP Mail Posted by Flakes on 31 Dec 2004 at 3:43 AM
: yes i have.
: Thanks for helping, i received your testing email already
:


I tried your code from here,giving hard coded values instead of those request values,and its working fine.So your code is fine.

Hope you get it to work.
Report
Just to be sure,... Posted by Flakes on 31 Dec 2004 at 4:46 AM
: : yes i have.
: : Thanks for helping, i received your testing email already
: :
:
:
: I tried your code from here,giving hard coded values instead of those request values,and its working fine.So your code is fine.
:
: Hope you get it to work.
:


Paste this at the top of your page,before all the email code:
Response.Write "Name=" & request.querystring("name") &"<br>"
Response.Write "Enquiry=" &  request.querystring("enquiry") 
Response.End


Do you see what you expected?
otherwise your code should work.




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.