Feedback script

Discussion for developers using MailEnable.
Post Reply
Guest

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.

json
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...

regards,
J.

Guest

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

Guest

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"
response.end
End if


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


strSubject = "ENTER YOUR SUBJECT HERE"
strFromName = Trim(Request.Form("name"))
strFromEmail = Trim(Request.Form("email"))
strToEmail = "melissa8781@hotmail.com"
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"
oMail.SendMessage
Set oMail = Nothing

response.redirect "thanks.asp"
response.end
%>

Guest

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

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

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

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..

Jake

Kiliman
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  = "http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSendUsingPort    = 2
Const cdoSMTPServer       = "http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdoSMTPAuthenticate = "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
Const cdoBasic            = 1
Const cdoSendUserName     = "http://schemas.microsoft.com/cdo/configuration/sendusername"
Const cdoSendPassword     = "http://schemas.microsoft.com/cdo/configuration/sendpassword"

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"
    .Update
End With

With iMsg
    .To       = """User A"" <userA@microsoft.com>"
    .From     = """User B"" <userB@microsoft.com>"
    .Subject  = "Hows it going? I've attached a document"
    .TextBody = "Hello world!"
    .AddAttachment "C:\files\mybook.doc"
    .Send
End With
You can find more information on MSDN.
http://msdn.microsoft.com/library/en-us ... saging.asp

Kiliman

Guest

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