Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Hi all help needed with sendmail.asp please

Hi all help needed with sendmail.asp please
Thread Tools
Fresh-Faced Recruit
Join Date: Jul 2006
Status: Offline
Reply With Quote
Jul 5, 2006, 07:08 AM
 
Hi everyone
This is my first post and i dare say there will be a few more by the time i'm finished.
Just wondering if one of you kind folk could help me to get my form up running by giving me an idiots guide with this sendmail.asp i was giving by my host provider.
I have made a form using golive cs2. i have no problem with dragging and dropping and arrangeing on a page but when it cames to this code malarkey well that's me finished.
What i need to know is what bits do i take out and what bits do i put it.
It even tells me in the asp file what to do but still can't get my head around. must be old age i dunno.

here is the asp code

In the get form data do i keep the entry request.form or do i replace this with my details not too sure about the referrer business but not i'm not sure about all of it.

any help would be much appreciated
thanks
mark

<%@LANGUAGE = VBSCRIPT%>
<html>
<body>

<%
' Get the form data
name = Request.Form("name")
senderEmail = Request.Form("email")
subject = "Regarding " & Request.Form("subject")
recipient = Request.Form("recipient")
body = Request.Form("body")
strReferer = request.servervariables("HTTP_REFERER")
strServer = Replace(request.servervariables("SERVER_NAME"),"ww w.","")
strSMTPServer = "smtp." & strServer

' check referer
intComp = inStr(strReferer, strServer)
If intComp > 0 Then
blnSpam = False
Else
' Spam Attempt Block
blnSpam = True
End If

' Create the JMail message Object
set msg = Server.CreateOBject( "JMail.Message" )

' Set logging to true to ease any potential debugging
' And set silent to true in case you wish to handle the errors yourself
msg.Logging = true
msg.silent = true

' Enter the sender data
msg.From = senderEmail

' Note that as addRecipient is a method and not
' a property, you do not use an equals ( = ) sign
msg.AddRecipient recipient

' The subject of the message
msg.Subject = subject

' And the body
msg.body = body

' Now send the message, using the indicated mailserver
If NOT blnSpam Then

if not msg.Send(strSMTPServer ) then
Response.write "<pre>" & msg.log & "</pre>"
else
Response.write "Message sent successfully!"
end if

end if

' Clear the object
set msg = nothing
%>
</body>
</html>
     
Baninated
Join Date: May 2005
Location: England
Status: Offline
Reply With Quote
Jul 6, 2006, 07:54 AM
 
hmm... im not a asp programmer, but you could try a PHP script.


i made one really easily with flash. its on my website(sig) goto PHP, then emailsender. if you want the code, PM me.
     
bodge  (op)
Fresh-Faced Recruit
Join Date: Jul 2006
Status: Offline
Reply With Quote
Jul 6, 2006, 11:30 AM
 
Hi ya Kick52

Thanks for the reply I will find if fasthost allow php like i said totally new to all this stuff.

I have been playing around with that code and i have manage to get the message message sent successfully when i press submit on my form but where the message goes beats me cuz i dont receive it ha ha ha i've gotta laugh now cuz i've spent alot of time banging my head against the wall and i seem to have a lot less hair now then when i started ha ha ha.

might give fasthosts yet another call to see if they can help.

cheers
mark
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 10:53 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2