Click to See Complete Forum and Search --> : Problem with JMail


plaszma
12-23-2010, 08:27 AM
Hello,
I want to send e-mails through JMail.SMTPMail in asp.
The problem is that it doesn't recognized the JMail object ....
Here is the code:

var result;
var email = /(\w+)@(\w+)\.(\w+)/g;
var src = Request.Form("email");
var values = new Array(3);
var required = new Array(3);
var index;
var objMail=Server.CreateObject("JMail.SMTPMail"); //here is the error...
result= email.exec(src);
//Response.Write(result+"");
if (result == null)
Response.Write("Adresa de e-mail incorecta");
else {
var your_email="";
var your_subject="";
var your_content="";
values =["name","email","message"];
required=["name","email","message"];
for(index==0;index<3;index++){
valoare=required[index];
if(Request.Form(valoare) == null){
Response.Write ("Va rugam introduceti campul" +valoare);
exit();
}
your_content += valoare + ":" + Request.Form(valoare);
}
/objMail.Silent=true;
var emailList=Request.Form("mail").split(/[\s;,]/);
var nEMail;
for (nEMail in emailList)
objMail.AddRecipient(emailList,nEMail);
objMail.From = "name@domain.com"
objMail.Subject="Solicitare";
objMail.Body=Request.Form("message");
objMail.Execute();
}

After I run this code on Windows Vista machine I obtain:

Server object error 'ASP 0177 : 800401f3'

Server.CreateObject Failed

/templates/Default.asp, line 9

800401f3

On Windows XP machine I obtain:

Error Type:
Server object, ASP 0177 (0x800401F3)
Invalid class string
/site/Default.asp, line 9

Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2)

Page:
GET /site/Default.asp

I don't know where it is that error from...Also I don't know if JMail is a third party component or it's already integrated.

Many Thanks,

yamaharuss
12-23-2010, 08:10 PM
You need to download and register the JMail component. Why not simply use CDO?

itHighway2007
01-13-2011, 11:23 PM
First check which email component is installed on your server.
Second provide appropriate smtp, from and to addresses.