lior r
lior r

Reputation: 2290

classic asp send mail

I am using this code to send email using classic ASP:

Set oJMail = Server.CreateObject("JMail.SMTPMail")
with oJMail
    .Sender = "myemail"
    .SenderName = "Me"
    .AddRecipient "some email"
    .Subject = "some subject"
    .Body = "Name: " & fname & " Email:" & email & "Phone: " & phone
end with

oJMail.ServerAddress = "mysmtp:25"
oJMail.Execute
Set oJMail = Nothing

But the server keep throwing this error:

Microsoft JScript compilation error '800a03ec'

Expected ';'

/index.asp, line 108

Set oJMail = Server.CreateObject("JMail.SMTPMail")
----^

Can it be something to do with my page header?

<%@ Language="javascript" %>

Upvotes: 0

Views: 1509

Answers (1)

Yes, that looks like VBScript code, in which case you'd want your page header to have:

<%@ Language="VBScript" %> 

Of course, this causes problems if the rest of your page is already written in JavaScript.

Upvotes: 2

Related Questions