I got a form which is used for clients to fill their info. When the clients submit the form, i want the submitted form will be sent to my email as an attachment. Is that possible?? Please send me the syntax to wirte that function!!!
yes, it is possible. you'll need to know which email component is installed on the server. That will determine the exact syntax that you would need. CDONTS and JMail are a couple of the most common and their syntax is very similar. code below doesn't include sending as an attachment but will give you the basic idea. we've been requesting the form contents and just concatenate a string called "body".
'SENDING EMAIL
Function SendEmail(subject,recipient,priority,body)
' Set JMail = Server.CreateObject("JMail.SMTPMail"
' JMail.ServerAddress = "myemailserver.com
' JMail.Sender = "myemail@mymail.com
' JMail.Subject = subject
' JMail.AddRecipient recipient
' JMail.Body = body
' JMail.Priority = priority
' JMail.ContentType = "text/html"
' JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR"
' JMail.Execute
' Set JMail=nothing
'CDONTS
Set objMail = Server.CreateObject("CDONTS.NewMail"
objMail.From = "myemail@mymail.com"
objMail.Subject = subject
objMail.To=recipient
objMail.Body=body
objMail.Importance=priority
objMail.MailFormat=0
objMail.BodyFormat=0
objMail.Send
Set objMail = Nothing
End Function
hth
mb
"Where's the Ka-Boom? There's supposed to be an Earth-shattering Ka-Boom!"
Marvin the Martian
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.