Forum Moderators: open

Message Too Old, No Replies

How do i post form data to my mail

problem with posting data to a mail

         

chalapathirao

8:44 pm on Apr 22, 2004 (gmt 0)

10+ Year Member



i am trying to send form data to a mail but i am getting an error "invalid class string"
i have used following code

Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = strName
Mailer.FromAddress=strEmail
Mailer.RemoteHost = "mail.example.com"
Mailer.AddRecipient "Username", "Username@example.com"
Mailer.Subject ="Query"
strMsgBody =strMsgBody & "Email:" & strEmail&vbCrLf& "Name:" & strName&vbCrLf&"Company:" & strCompany&vbCrLf&"Phone:" & strPhone&vbCrLf&vbCrLf&"Query About:" & strQuery
Mailer.BodyText = strMsgBody

do i require to install any component, or what is the problem.Please any one educate me on this issue and help me.

[edited by: Xoc at 11:28 pm (utc) on April 22, 2004]
[edit reason] made domain name and email address generic [/edit]

f00sion

12:30 am on Apr 23, 2004 (gmt 0)

10+ Year Member



in your server.createobject you are trying to use the aspmail component from serverobjects..which must be purchased and installed on your server.. it is available at serverobjects.com

Krapulator

2:00 am on Apr 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use CDO instead

Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = strEmail & " (" & strName & ")"
objMail.Subject = "Query"
objMail.To = "Username@example.com (Username)"
objMail.BodyFormat = 0
objMail.MailFormat = 0
objMail.Body = strMsgBody & "Email:" & strEmail&vbCrLf& "Name:" & strName&vbCrLf&"Company:" & strCompany&vbCrLf&"Phone:" & strPhone&vbCrLf&vbCrLf&"Query About:" & strQuery
objMail.Send
set objMail = nothing

chalapathirao

3:06 pm on Apr 23, 2004 (gmt 0)

10+ Year Member



thanks a lot for the suggestion guys. you people are doing a great job.

chalapathirao

4:54 pm on Apr 23, 2004 (gmt 0)

10+ Year Member



i have used CDONTS as you specified , but still i am getting an error message as Invalis class string. i guess the error is with the mail object. Do i need to configure my server or any other technical steps to follow

DO throw some light on the issues i have to take care while using such code, areas to check for