12 years ago
Send email function do not send emails
Hi!
I am your custumer with standard licence. During using your product, I get into trouble with sendmail function.
Here is my function:
function SendEmail(mFrom, mTo, mSubject, mBody, mAttach)
{
var i, schema, mConfig, mMessage;
try
{
mConfig = Sys.OleObject("CDO.Configuration");
mConfig.Fields.Item(schema + "sendusing") = 2; // cdoSendUsingPort
mConfig.Fields.Item(schema + "smtpserver") = "smtp.gmail.com"; // SMTP server
mConfig.Fields.Item(schema + "smtpserverport") = 465; // Port number
mConfig.Fields.Item(schema + "smtpauthenticate") = 2; // Authentication mechanism
mConfig.Fields.Item(schema + "smtpusessl") = true;
mConfig.Fields.Item(schema + "sendusername") = "irina"; // User name (if needed)
mConfig.Fields.Item(schema + "sendpassword") = "******"; // User password (if needed)
mConfig.Fields.Update();
mMessage = Sys.OleObject("CDO.Message");
mMessage.Configuration = mConfig;
mMessage.From = mFrom;
mMessage.To = mTo;
mMessage.Subject = mSubject;
mMessage.HTMLBody = mBody;
aqString.ListSeparator = ",";
for(i = 0; i < aqString.GetListLength(mAttach); i++)
mMessage.AddAttachment(aqString.GetListItem(mAttach, i));
mMessage.Send();
}
catch (exception)
{
Log.Error("E-mail cannot be sent", exception.description);
return false;
}
Log.Message("Message to <" + mTo + "> was successfully sent");
return true;
}
function MainTest()
{
if( SendEmail("irina@gmail.com", "dmitri@gmail.com", "Subject",
"Message body", "e:\\File1.txt") )
Log.Message("OK");
else
Log.Message("Not OK");
}
The message was not sent. In the log I saw an error:
The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available.
What is the probleme? Soomething wrong with mail server? May be you recommend another one?
I am your custumer with standard licence. During using your product, I get into trouble with sendmail function.
Here is my function:
function SendEmail(mFrom, mTo, mSubject, mBody, mAttach)
{
var i, schema, mConfig, mMessage;
try
{
mConfig = Sys.OleObject("CDO.Configuration");
mConfig.Fields.Item(schema + "sendusing") = 2; // cdoSendUsingPort
mConfig.Fields.Item(schema + "smtpserver") = "smtp.gmail.com"; // SMTP server
mConfig.Fields.Item(schema + "smtpserverport") = 465; // Port number
mConfig.Fields.Item(schema + "smtpauthenticate") = 2; // Authentication mechanism
mConfig.Fields.Item(schema + "smtpusessl") = true;
mConfig.Fields.Item(schema + "sendusername") = "irina"; // User name (if needed)
mConfig.Fields.Item(schema + "sendpassword") = "******"; // User password (if needed)
mConfig.Fields.Update();
mMessage = Sys.OleObject("CDO.Message");
mMessage.Configuration = mConfig;
mMessage.From = mFrom;
mMessage.To = mTo;
mMessage.Subject = mSubject;
mMessage.HTMLBody = mBody;
aqString.ListSeparator = ",";
for(i = 0; i < aqString.GetListLength(mAttach); i++)
mMessage.AddAttachment(aqString.GetListItem(mAttach, i));
mMessage.Send();
}
catch (exception)
{
Log.Error("E-mail cannot be sent", exception.description);
return false;
}
Log.Message("Message to <" + mTo + "> was successfully sent");
return true;
}
function MainTest()
{
if( SendEmail("irina@gmail.com", "dmitri@gmail.com", "Subject",
"Message body", "e:\\File1.txt") )
Log.Message("OK");
else
Log.Message("Not OK");
}
The message was not sent. In the log I saw an error:
The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available.
What is the probleme? Soomething wrong with mail server? May be you recommend another one?