I have a page written in asp and javascript. I'm trying to send an email using CDO.Message and when i run the page the error that occurs is:
[u]
The SendUsing value is invalid.</u>
On the other hand i tried to send the email using CDONTS.NewMail and my error is
[u]
Permission Denied.</u>
Here is my code for the two solutions.
var Msg = new ActiveXObject("CDO.Message");
var Config = new ActiveXObject("CDO.Configuration");
Bp = Msg.BodyPart;
configFlds = Config.Fields;
var cdoSendUsingPort = 2;
Flds = Bp.Fields;
configFlds("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "servername.somewhere.gr";
configFlds("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25;
configFlds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2;// CdoSendUsing enum value = 2
configFlds("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10;
configFlds.Update();
Flds("urn:schem=:mailheader:content-type") = micalg=SHA1";
"text/plain; charset='iso-8859-1'";
Flds("urn:schemas:mailheader:content-disposition")= "attachment;filename="+mid+".txt";
Flds("urn:schemas:mailheader:content-transfer-encoding") = "";
Flds("urn:schemas:httpmail:content-disposition-type") = "attachment";
Flds("urn:schemas:mailheader:content-language") = "el";
Flds("urn:schemas:mailheader:content-transfer-encoding") ="quoted-printable";
Flds("urn:schemas:mailheader:content-transfer-encoding") ="7bit";
Msg.To = "
[email protected]";
Msg.From = "
[email protected]";
Msg.Subject = "This is an auction";
Msg.TextBody = "here is my file";
Msg.AddAttachment("c:\\db\\dimitra\\myfile.txt");//saved on server
Msg.Send();
And the code for my second solution is:
var CdoBodyFormatText = 1;
var CdoMailFormatText = 1;
var CdoEncodingBase64 = 1;
var CdoHigh = 2;
email = new ActiveXObject("CDONTS.NewMail");
email.To = "
[email protected]";
email.From = "
[email protected]";
email.Subject = "Hope you get this mail";
email.Body = "Yes now you are reading the contents of the mail";
email.BodyFormat = 1;
email.MailFormat = 1;
email.Importance = 2;
email.AttachFile("c:\\db\\dimitra\\member1\\Docs\\ 11.txt",1);
email.Send();
email = null;
As i read i had to check the configuration settings and i think that i have done that correctly.Moreover i have chechked the file and directory permissions and i have given read and execute.I use the CDONTS.dll
I do not know what else to do, so please help me. Any kind of information worths.
Thank you very much!:)