www.Inmagic.com    Inmagic Forums    Inmagic Forums  Hop To Forum Categories  Scripting    E-mail script
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
AT
Posted
I'm using a variation of the Script to E-mail a report (below) but it keeps coming up with the message "Form: 'Email Form' not found" but I don't know why. It's certainly the right name for the form. (I'm using MAPI if that makes a difference)

function email_onClick()
{
if (Application.activeTextbase.currentRecordSet.RecordCount > 0)
{
var smDesc = Command.newSendMailDescriptor();

smDesc.formatOpt = smDesc.FormatOptBODYTEXT;

smDesc.reportFormName = "Email Form";
smDesc.reportFormFlag = smDesc.ReportFormFlagPRIVATE;

Command.sendMailEx(smDesc);

var sendCnt = smDesc.SendCnt;
var failCnt = smDesc.SendFailCnt;

Application.message("Send Mail operation done.\r"+
sendCnt+" messages sent,\r"+
failCnt+" messages not sent.");
}
else
Application.message("There is no current set.");
}

Thanks!
 
Posts: 66 | Location: Essex | Registered: Fri April 29 2005Reply With QuoteEdit or Delete MessageReport This Post
Posted Hide Post
Is the form saved as a public form or a private form? If it has "(public)" after the name in the form list, that would explain why you are getting the message, since your script has:

smDesc.reportFormFlag = smDesc.ReportFormFlagPRIVATE;
 
Posts: 217 | Registered: Wed June 29 2005Reply With QuoteEdit or Delete MessageReport This Post
AT
Posted Hide Post
Apologies! Solved the first problem - my form was Public not Private but now it still says:

Send Mail operation done.
0 messages sent,
1 messages not sent

Now I know that the Script has a send option (which I don't need it to do as I'm just wanting it to open in a mail message) so how do I take that part out? I assume the following is hopelessly off track?

function email_onClick()
{
if (Application.activeTextbase.currentRecordSet.RecordCount > 0)
{
var smDesc = Command.newSendMailDescriptor();

smDesc.formatOpt = smDesc.FormatOptBODYTEXT;

smDesc.reportFormName = "RECALL";
smDesc.reportFormFlag = smDesc.ReportFormFlagPUBLIC;
}
}
 
Posts: 66 | Location: Essex | Registered: Fri April 29 2005Reply With QuoteEdit or Delete MessageReport This Post
AT
Posted Hide Post
Have now tried using SMTP and I'm getting the message "0 messages sent 0 messages not sent" There is only one record in the report so I know that shouldn't be a problem. Any help (script below)?

function email_onClick()
{
if (Application.activeTextbase.currentRecordSet.RecordCount > 0)
{
var smDesc = Command.newSendMailDescriptor();

smDesc.formatOpt = smDesc.FormatOptBODYTEXT;

smDesc.emailFrom = "allrecordmanagementservicels@essex.gov.uk";
smDesc.emailTo = "ambertaylor@essex.gov.uk";
smDesc.emailSubject = "test message";


smDesc.reportFormName = "Email Form";

Command.sendMailEx(smDesc);

var sendCnt = smDesc.SendCnt;
var failCnt = smDesc.SendFailCnt;

Application.message("Send Mail operation done.\r"+
sendCnt+" messages sent,\r"+
failCnt+" messages not sent.");
}
else
Application.message("There is no current set.");
}

This message has been edited. Last edited by: AT,
 
Posts: 66 | Location: Essex | Registered: Fri April 29 2005Reply With QuoteEdit or Delete MessageReport This Post
AT
Posted Hide Post
Checked the Log file and the SMTP is nto working because it can't connect so I've finally given up on that.

When I try MAPI I get "MAPI error 2" in the log file - does anyone know what error this is? I can send by MAPI using the option on the Files tab with no problems.
 
Posts: 66 | Location: Essex | Registered: Fri April 29 2005Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 

www.Inmagic.com    Inmagic Forums    Inmagic Forums  Hop To Forum Categories  Scripting    E-mail script