Hi Guys,

As my ISP does support .asp but not CODOSYS, I was hoping someone might be able to help me convert this into simple .asp email script or something?

<%
'sets form variables
dim sendtoemail, sendtoname, sentfromname, sentfromemail, messagesubject, messagebody, url, Email_SMTPAddress, Email_ServerComponent
sendtoemail = request.form("sendtoemail")
sendtoname = request.form("sendtoname")
sentfromname = request.form("sentfromname")
sentfromemail = request.form("sentfromemail")
messagesubject = request.form("messagesubject")
messagebody = request.form("messagebody")
url = request.form("url")
Email_SMTPAddress = request.form("Email_SMTPAddress")
Email_ServerComponent = request.form("Email_ServerComponent")
'sets message body for inc_sendtofriendmanager
If request.form("form") = "SendToFriendManager" Then
messagebody =   messagebody & vbCrLf _
				& vbCrlf & "Here is the link" _
				& vbCrlf & url _
				& vbCrlf
End if
'sets message body for inc_sendreplymanager
If request.form("form") = "SendReplyManager" Then
messagebody =   messagebody & vbCrLf _
				& vbCrlf
End if

Set sendmail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration") 
Set Flds = objCDOSYSCon.Fields

'Out going SMTP server 
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtp-au.server-mail.com
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
objCDOSYSCon.Fields.Update 

set sendmail.Configuration = objCDOSYSCon 
sendmail.From = sentfromemail'The mail is sent to the address declared in the form variable.
sendmail.To = sendtoemail
sendmail.Subject = messagesubject & ": sent from " & sentfromname  ' The subject is set in the form variable
'This is the content of thr message.
sendmail.TextBody =  messagebody
sendmail.Send 'Send the email!
'Close the server mail object 
Set sendmail = Nothing 
Set objCDOSYSCon = Nothing 

Response.Redirect( Request.ServerVariables("HTTP_REFERER") & "&sent=yes&sendtoemail=" & sendtoemail)
%>

Damn look at all that junk, just to send an email.

Sorry, I don't have an answer as I am a php dev. I was just surprised that's all.

Damn look at all that junk, just to send an email.

Sorry, I don't have an answer as I am a php dev. I was just surprised that's all.

If you have a good registration and login script with multiple security levels, I would love to see it.

Kind regards,

Steve

This article has been dead for over six months. Start a new discussion instead.