Пример #1
0
            private static void P_SendSingleRecipientNoAttachment(string from, string to, string subject, string body, bool bHtml, SendMailFunc sender)
            {
                MailMessage msg = P_CreateMailMessage(from, to, subject, body, bHtml);

                sender(msg);
            }
Пример #2
0
            private static void P_SendSingleRecipientSingleAttachment(string from, string to, string subject, string body, bool bHtml, string attachment, SendMailFunc sender)
            {
                MailMessage msg = P_CreateMailMessage(from, to, subject, body, bHtml);

                msg.Attachments.Add(new Attachment(attachment));

                sender(msg);
            }
Пример #3
0
            private static void P_SendSingleRecipientNoAttachment(string from, string to, string subject, string body, bool bHtml, SendMailFunc sender)
            {
                MailMessage msg = P_CreateMailMessage(from, to, subject, body, bHtml);

                sender(msg);
            }
Пример #4
0
            private static void P_SendSingleRecipientMultiAttachment(string from, string to, string subject, string body, bool bHtml, string[] arrAttachments, SendMailFunc sender)
            {
                MailMessage msg = P_CreateMailMessage(from, to, subject, body, bHtml);

                foreach (string attach in arrAttachments)
                {
                    msg.Attachments.Add(new Attachment(attach));
                }

                sender(msg);
            }
Пример #5
0
            /// <summary>
            /// Send email using Exchange to multiple receipients with multiple attachments
            /// </summary>
            /// <param name="from">(string) sender's email address</param>
            /// <param name="arrTo">(string []) an array of recipient's email addresses</param>
            /// <param name="subject">(string) message subject</param>
            /// <param name="body">(string) message body/copy</param>
            /// <param name="bHtml">(bool) HTML format or plain text</param>
            /// <param name="arrAttachments">(string []) an array of attachment file paths</param>
            /// <param name="host">(string) IP/url of smtp</param>
            /// <param name="port">(int) port</param>
            /// <param name="strUID">(string) username for exhange</param>
            /// <param name="strPsw">(string) password for exchange</param>
            public static void sendEmailExchange(string from, string[] arrTo, string subject, string body, bool bHtml, string[] arrAttachments, string host, int port, string strUID, string strPsw)
            {
                SendMailFunc sender = (msg) => P_SendMessageExchange(msg, host, port, strUID, strPsw);

                P_SendMultiRecipientMultiAttachment(from, arrTo, subject, body, bHtml, arrAttachments, sender);
            }
Пример #6
0
            /// <summary>
            /// Send email using Exchange to a single receipient with a single attachment
            /// </summary>
            /// <param name="from">(string) sender's email address</param>
            /// <param name="to">(string) recipient's email address</param>
            /// <param name="subject">(string) message subject</param>
            /// <param name="body">(string) message body/copy</param>
            /// <param name="bHtml">(bool) HTML format or plain text</param>
            /// <param name="attachment">(string) attachment file path</param>
            /// <param name="host">(string) IP/url of smtp</param>
            /// <param name="port">(int) port</param>
            /// <param name="strUID">(string) username for exhange</param>
            /// <param name="strPsw">(string) password for exchange</param>
            public static void sendEmailExchange(string from, string to, string subject, string body, bool bHtml, string attachment, string host, int port, string strUID, string strPsw)
            {
                SendMailFunc sender = (msg) => P_SendMessageExchange(msg, host, port, strUID, strPsw);

                P_SendSingleRecipientSingleAttachment(from, to, subject, body, bHtml, attachment, sender);
            }
Пример #7
0
            /// <summary>
            /// Send email to a single receipient with mulitple attachments
            /// </summary>
            /// <param name="from">(string) sender's email address</param>
            /// <param name="to">(string) recipient's email address</param>
            /// <param name="subject">(string) message subject</param>
            /// <param name="body">(string) message body/copy</param>
            /// <param name="bHtml">(bool) HTML format or plain text</param>
            /// <param name="arrAttachments">(string []) an array of attachment file paths</param>
            /// <param name="host">(string) IP/url of smtp</param>
            /// <param name="port">(int) port</param>
            public static void sendEmail(string from, string to, string subject, string body, bool bHtml, string[] arrAttachments, string host, int port)
            {
                SendMailFunc sender = (msg) => P_SendMessage(msg, host, port);

                P_SendSingleRecipientMultiAttachment(from, to, subject, body, bHtml, arrAttachments, sender);
            }
Пример #8
0
            private static void P_SendMultiRecipientMultiAttachment(string from, string[] arrTo, string subject, string body, bool bHtml, string[] arrAttachments, SendMailFunc sender)
            {
                MailMessage msg = P_CreateMailMessage(from, arrTo, subject, body, bHtml);

                foreach (string attach in arrAttachments)
                {
                    msg.Attachments.Add(new Attachment(attach));
                }

                sender(msg);
            }
Пример #9
0
            private static void P_SendMultiRecipientSingleAttachment(string from, string[] arrTo, string subject, string body, bool bHtml, string attachment, SendMailFunc sender)
            {
                MailMessage msg = P_CreateMailMessage(from, arrTo, subject, body, bHtml);

                msg.Attachments.Add(new Attachment(attachment));

                sender(msg);
            }