示例#1
0
 public void sendMail(string sFrom, string sTo, string sCC, string sBCC, string sSubject, string sBody, CMMailFormat format, CMAttachment[] attachments, out string outError)
 {
     mail.sendMail(sFrom, sTo, sCC, sBCC, sSubject, sBody, format, attachments, out outError);
 }
示例#2
0
        private static bool creaMail(string subject, string bodyMail, string server, string mailMitt, string smtp_user, string smtp_pwd, string mailDest, string mailDestCC, string port, string SmtpSsl, string PopSsl, string smtpSTA, string X_TipoRicevuta, CMAttachment[] attachments, CMMailFormat format, out string statusString)
        {
            bool retValue = false;

            logger.Debug("Start");
            SvrPosta svr = new SvrPosta(server,
                                        smtp_user,
                                        smtp_pwd,
                                        port,
                                        null,
                                        CMClientType.SMTP, SmtpSsl, PopSsl, smtpSTA);

            try
            {
                svr.connect();
                List <CMMailHeaders> headers = new List <CMMailHeaders>();
                if ((X_TipoRicevuta != null) && (X_TipoRicevuta != string.Empty))
                {
                    headers.Add(new CMMailHeaders {
                        header = "X-TipoRicevuta", value = X_TipoRicevuta
                    });
                }

                svr.sendMail(mailMitt, mailDest, mailDestCC, String.Empty, subject, bodyMail, format, attachments, out statusString);
                //svr.sendMail(mailMitt, mailDest, mailDestCC, String.Empty, subject, bodyMail, CMMailFormat.Text, attachments,out statusString);
                retValue = true;
            }
            catch (Exception e)
            {
                logger.ErrorFormat("Invio Mail traimte creaMail con errore {0} : {1} ", e.Message, e.StackTrace);
                errorMessage = e.Message;
                throw e;
            }
            finally
            {
                svr.disconnect();
            }
            logger.Debug("End");
            return(retValue);
        }