PDA

Click to See Complete Forum and Search --> : emial form...


BloodMachine34
Dec 3rd, 2000, 06:43 PM
Does anyonw know how to make an email form in different language than html, to avoid the confirm box after clicking send?

Danial
Dec 3rd, 2000, 07:38 PM
Yes,
You can use CGI like ASP, PERL and other to write form mailer. Personally i use ASP. Here is an ASP code that i used in one of my web site. I placed the ASP page in http://www.domaindlx.com who gives you free web space with ASP supports.

Here is the code

<%
dim name, email, firstName, nameLength

name=request.querystring("name")
email=request.querystring("Email")

'extract the first name from the full name
if name<>"" then

nameLength=len(name)

for i=0 to nameLength
if mid(name, i+1, 1)<>" " then
firstName=firstName+mid(name, i+1, 1)
else
exit for
end if
next
end if


Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "mail.btinternet.com"
Mail.From = email
Mail.FromName = name
Mail.AddAddress "yourname@hostname.com", "Danial Atique" 'A POP3 email account
Mail.Subject = "Add me to the mailing list"

BodyMsg = BodyMsg + "Name : " & name & Chr(10)
BodyMsg = BodyMsg + "Email : " & email & Chr(10)

Mail.Body = BodyMsg

On Error Resume Next
Mail.Send

If Err <> 0 Then
ErrMsg = "Your request was not sent due to the following error: " & Err.Description
Else
ErrMsg = "<h2 align=center>Hi " + firstName + "<br>Your email has been added to the<BR>"
ErrMsg=ErrMsg + "mailing list. You will be notified when new song or albums are added.<br>"

End If

dim bodyText

bodyText="<html><head><title>Song Request</title><body bgcolor='#006666' text='#ffffff'>"
bodyText=bodyText + ErrMsg
bodyText=bodyText + "</body></html>"

response.write bodyText

%>