Feedback script

Discussion for developers using MailEnable.
Post Reply

Feedback script

Post by Guest » Wed Jan 21, 2004 7:50 pm

Stupid question but my host is using mailenable on their servers and i need to find a simple script for feedback forms on my website. Can anyone share one or point me to a site with mailenable scripts? Any help would be appreciated since I'm kinda new to ASP.

Posts: 227
Joined: Sun Aug 24, 2003 6:56 pm
Location: Denmark

Post by json » Thu Jan 22, 2004 7:39 am

What components are installed on the server? Any mail components apart from Mail Enable? Like JMail, or..??

The fact that ME is installed on the server doesn't change the way you should use the mail components. But you need to ask the host if authentication is required or...



Post by Guest » Thu Jan 29, 2004 2:12 am

Thanks for replying...

The host just said mailenable is installed and CDONTS and Jmail are disabled due to security reasons?! He said to find a script using mailenable..I am still awaiting an answer if authentication is required


Post by Guest » Thu Jan 29, 2004 10:53 pm

here is my code:


name = request.form("name")
email = request.form("email")
message = request.form("message")

If name="" or email="" or message="" Then
url = "contact.asp?reqd=* indicates required field&name=" & name & "&email=" & email & "&message=" & message
If name="" Then
url = url & "&mname=*"
End if

If email="" Then
url = url & "&memail=*"
End if

If message="" Then
url = url & "&mmessage=*"
End if

response.redirect url & "&foobar=foobar#form"
End if

Dim oMail ' Email object
Dim strFromName ' From persons' real name
Dim strFromEmail, strToEmail ' Email addresses
Dim strSubject, strBody ' Message
Dim misccompo

strFromName = Trim(Request.Form("name"))
strFromEmail = Trim(Request.Form("email"))
strToEmail = ""
strBody = Trim(Request.Form("message"))

Set oMail = server.CreateObject("MEMail.Message")
oMail.MailFrom = strFromName & " <" & strFromEmail & ">"
oMail.MailTo = strToEmail
oMail.Subject = strSubject
oMail.MessageBody = "--------------------------------------" & vbcrlf & vbcrlf & strbody & vbcrlf & vbcrlf & vbcrlf & "--------------------------------------------------------------" & vbcrlf & "MESSAGE ENDS: End of message"
Set oMail = Nothing

response.redirect "thanks.asp"


Post by Guest » Sat Jan 31, 2004 2:53 pm

My host says authentication is required...can anyone help?

Posts: 36
Joined: Mon Nov 03, 2003 9:41 pm

Post by DevelopStuff » Sat Jan 31, 2004 7:37 pm

You'll have to use raw sockets.. or a component that wraps the raw sockets..


Posts: 279
Joined: Mon Feb 03, 2003 2:44 pm
Location: Chesapeake, VA

Post by Kiliman » Sat Jan 31, 2004 9:38 pm

Ironically it appears that ME's own SendMail COM component does not support authentication.

You said your provider disabled CDONTS and JMail. You might want to see if CDOSYS is available. I'm assuming the host is using Windows 2000/2003 server.

Here is sample code to send email using CDOSYS:

Code: Select all

' Define CDOSYS constants
Const cdoSendUsingMethod  = ""
Const cdoSendUsingPort    = 2
Const cdoSMTPServer       = ""
Const cdoSMTPAuthenticate = ""
Const cdoBasic            = 1
Const cdoSendUserName     = ""
Const cdoSendPassword     = ""

Dim iMsg
Set iMsg = CreateObject("CDO.Message")

With iMsg.Configuration.Fields
    .Item(cdoSendUsingMethod)  = cdoSendUsingPort
    .Item(cdoSMTPServer)       = "localhost"
    .Item(cdoSMTPAuthenticate) = cdoBasic
    .Item(cdoSendUserName)     = "username"
    .Item(cdoSendPassword)     = "password"
End With

With iMsg
    .To       = """User A"" <>"
    .From     = """User B"" <>"
    .Subject  = "Hows it going? I've attached a document"
    .TextBody = "Hello world!"
    .AddAttachment "C:\files\mybook.doc"
End With
You can find more information on MSDN. ... saging.asp



Post by Guest » Sun Feb 01, 2004 6:28 pm

Thanks so much Kiliman your code has worked! The host kept telling me to use MEMail.message...I really appreciate your help

Post Reply