469,950 Members | 1,391 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

ASP - Error send mail 'Invalid class string'

1- The code snippet in my post #61 adds the date automatically

2- When filling in the mail body text, I would put all the data into a separate string variable, and then send this to the mail body text:
Expand|Select|Wrap|Line Numbers
  1. dim myBody
  2. for each x in request.form
  3.    myBody = myBody & x & ": " & request.form(x) & vbNewLine
  4. next
  5. Mail.BodyText   = myBody
the rest of your code should work just fine.

Jared
sorry to but in unannounced, I am a newbie to this forum, thank you all for the enormous help this forum has already been and I am sure will continue to be.....

my question relates to send emails from a VBscript in asp.net. I have tried using the cod above and get the following error message:

Error Type:
Server object, ASP 0177 (0x800401F3)
Invalid class string
/leadqualifiers.co.uk/httpdocs/appshandlingBU.asp, line 185

line 185 is
185 [code]et Mail = Server.CreateObject("SMTPsvg.Mailer")[code]

does this variable require particular email component on the server ? or is my problem different ?

any ideas ?
Jul 23 '08 #1
2 2153
DrBunchman
979 Expert 512MB
Hi sandh2008,

Welcome to Bytes.com! I hope you find the site useful. I've split your question into a new thread to save use from scrolling through 60 posts to get to it as that other thread was pretty long! :-)

I believe you are correct: you are missing the required dll to use this mail object. To try to fix this you could use CDOSYS instead by swapping the line above with this one:
Expand|Select|Wrap|Line Numbers
  1.  
  2. Set Mail = Server.CreateObject("CDO.Message")
  3.  
I'm not familiar with the syntax of the mail object you are using so don't know if there's any difference but the basic properties of CDOSYS are these:
Expand|Select|Wrap|Line Numbers
  1.  
  2. Mail.Subject = "Subject"
  3. Mail.From = "Me!"
  4. Mail.To = "You!"
  5. Mail.TextBody = "Hello World!
  6. Mail.AddAttachment "MyPicture.jpg"
  7. Mail.Send
  8.  
And there's plenty more info in the www.

Let me know if this fixes your problem.

Dr B
Jul 23 '08 #2
Jerry Winston
145 Expert 100+
CDOSYS works pretty well for me using these settings:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Set myMail=Server.CreateObject("CDO.Message")              
  3. dim bodyText
  4. myMail.From = "myEmail@mysite.com"
  5. myMail.Subject = "My Subject Line"
  6. myMail.To = "yourEmail@yourSite.com"
  7. myMail.BCC = "secretGuy@secretSite.com"
  8.  
  9.  

Expand|Select|Wrap|Line Numbers
  1.       myMail.HTMLBody=bodyText  
  2.  
  3. myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
  4.  
  5. myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "127.0.0.1" 
  6.  
  7. myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "C:\Inetpub\mailroot\Drop"  
  8.  
  9. myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25  
  10.  
  11. myMail.Configuration.Fields.Update        
  12. myMail.Send       
  13. set myMail=nothing
  14.  
Jul 25 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

8 posts views Thread by VB Programmer | last post: by
6 posts views Thread by Alixx Skevington | last post: by
16 posts views Thread by | last post: by
2 posts views Thread by =?Utf-8?B?QWRl?= | last post: by
6 posts views Thread by Dave Kelly | last post: by
2 posts views Thread by upendrajpr | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.