User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 360,994 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,522 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting

Help with asp form will not display contact information

Join Date: Aug 2005
Posts: 6
Reputation: sinister747 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
sinister747 sinister747 is offline Offline
Newbie Poster

Re: Help with asp form will not display contact information

  #10  
Dec 29th, 2005
Hi All,

First of all the script i have posted above is now working fine, However i want to make it a little more advanced!.

I now have setup a system for sending Receipts to members of our Gaming Community.

What happens is this.

1st Page.

On the first page it takes information from a Database and places it into Text Boxs on a Form.

I then edit the information in the text boxs and hit Submit to send the email.

So the FORM submits to my page that sends the mail like the script above, But for some reason it WONT send the mail.

If i make it send a Textbox called " body " then it works fine, but i can't get it to send the information in HTML format.

All help will be appreciated as you's dealt with my problem very professionally last time i feel there is no other place to go.

Code Below;

<%
Name = Request.Form("name")
SenderEmail = Request.Form("email")
Subject = "DIRTY RATS CLAN - Payment Received"

'// declare variable names to hold the form field values
Dim strusername, strname, strdate, stramount, strpaypalfee, stramountreceived, strcovertill, stramountdue, strduedate, strcovermonth, strnotes, strID

' Get the form data
strID = Request.Form("id")
strusername = Request.Form("username")
strname = Request.Form("name")
strdate = Request.Form("date")
stramount = Request.Form("amount")
strpaypalfee = Request.Form("paypalfee")
stramountreceived = Request.Form("amountreceived")
strcovertill = Request.Form("covertill")
stramountdue = Request.Form("amountdue")
strduedate = Request.Form("duedate")
strcovermonth = Request.Form("covermonth")
strnotes = Request.Form("notes")
senderEmail = Request.Form("email")
subject = "DIRTY RATS CLAN - Payment Notification For" & Request.Form("username")
recipient = Request.Form("recipient")
strReferer = request.servervariables("HTTP_REFERER")
strServer = Replace(request.servervariables("SERVER_NAME"),"www.","")
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 = "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">" & vbCrLf _
& "<html>" & vbCrLf _
& "<head>" & vbCrLf _
& " <title>Sample Message From ASP 101</title>" & vbCrLf _
& " <meta http-equiv=Content-Type content=""text/html; charset=iso-8859-1"">" & vbCrLf _
& "</head>" & vbCrLf _
& "<body bgcolor=""#383838"">" & vbCrLf _
& " Dear " & strusername & vbCrLf _
& "You are receiving this receipt due to a recent update to your Monthly Subscription Fee." & vbCrLf _
& "Please find your receipt below;" & vbCrLf _
& " -----------------------------------------------------------------------------------" & vbCrLf _
& " Our Referance No : " & strID & vbCrLf _
& " Name: " & strname & vbCrLf _
& " Username: " & strusername & vbCrLf _
& " Item Title: Dirty Rats Clan - Monthly Subscription Fee " & vbCrLf _
& " ----------------------------------------------------------------------------------- " & vbCrLf _
& " Invoice Payment Date: " & vbCrLf _
& " Payment Cover Till: " & vbCrLf _
& " ----------------------------------------------------------------------------------- " & vbCrLf _
& " >> Amount Sent: " & stramount & vbCrLf _
& " >> Transfer Fee: " & strpaypalfee & vbCrLf _
& " >> Total Received: " & stramountreceived & vbCrLf _
& " ----------------------------------------------------------------------------------- " & vbCrLf _
& " <p> " & vbCrLf _
& " This message (including any attachments) is confidential and may be " & vbCrLf _
& " legally privileged. If you are not the intended recipient, you should " & vbCrLf _
& " not disclose, copy or use any part of it - please delete all copies " & vbCrLf _
& " immediately and notify DIRTY RATS CLAN on FalseEmail@Dirtyratsclan.com " & vbCrLf _
& " </p> " & vbCrLf _
& " <p> " & vbCrLf _
& " Any information, statements or opinions contained in this message " & vbCrLf _
& " (including any attachments) are given by the author. They are not " & vbCrLf _
& " given on behalf of DIRTY RATS CLAN unless subsequently confirmed by an individual " & vbCrLf _
& " other than the author who is duly authorised to represent DIRTY RATS CLAN. " & vbCrLf _
& " </p> " & vbCrLf _
& " DIRTY RATS CLAN is registered in the Republic of Ireland & United Kingdom." & vbCrLf _
& "</body>" & vbCrLf _
& "</html>" & vbCrLf

' 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 Sucessfully!"
end if

end if

%>
<body>
<p class="style2"><a href="WITHHELD" target="_self"><strong>Return to Admin Menu </strong></a></p>
</body>
</html>
<%
' Clear the object
set msg = nothing
%>


Thank you in advance.

Regards,
Sinister747
Reply With Quote  
All times are GMT -4. The time now is 6:34 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC