예제 #1
0
        /// <summary>
        /// Helper Method for creating an Email with Attachment
        /// </summary>
        /// <param name="fullpath">Path to file</param>
        /// <param name="captureDetails"></param>
        public static void SendImage(string fullPath, string title)
        {
            MapiMailMessage message = new MapiMailMessage(title, null);

            message.Files.Add(fullPath);
            message.ShowDialog();
        }
예제 #2
0
        /// <summary>
        /// Helper Method for creating an Email with Attachment
        /// </summary>
        /// <param name="fullpath">Path to file</param>
        /// <param name="captureDetails"></param>
        public static void SendImage(string fullPath, string title, bool deleteFileOnExit)
        {
            MapiMailMessage message = new MapiMailMessage(title, null);

            message.Files.Add(fullPath);
            message.ShowDialog(deleteFileOnExit);
        }
예제 #3
0
		/// <summary>
		/// Helper Method for creating an Email with Attachment
		/// </summary>
		/// <param name="fullPath">Path to file</param>
		/// <param name="title"></param>
		public static void SendImage(string fullPath, string title) {
			using (MapiMailMessage message = new MapiMailMessage(title, null)) {
				message.Files.Add(fullPath);
				if (!string.IsNullOrEmpty(conf.MailApiTo)) {
					message._recipientCollection.Add(new Recipient(conf.MailApiTo, RecipientType.To));
				}
				if (!string.IsNullOrEmpty(conf.MailApiCC)) {
					message._recipientCollection.Add(new Recipient(conf.MailApiCC, RecipientType.CC));
				}
				if (!string.IsNullOrEmpty(conf.MailApiBCC)) {
					message._recipientCollection.Add(new Recipient(conf.MailApiBCC, RecipientType.BCC));
				}
				message.ShowDialog();
			}
		}
예제 #4
0
파일: MailHelper.cs 프로젝트: zhk/greenshot
 /// <summary>
 /// Helper Method for creating an Email with Attachment
 /// </summary>
 /// <param name="fullPath">Path to file</param>
 /// <param name="title"></param>
 public static void SendImage(string fullPath, string title)
 {
     using (MapiMailMessage message = new MapiMailMessage(title, null)) {
         message.Files.Add(fullPath);
         if (!string.IsNullOrEmpty(CoreConfig.MailApiTo))
         {
             message.Recipients.Add(new Recipient(CoreConfig.MailApiTo, RecipientType.To));
         }
         if (!string.IsNullOrEmpty(CoreConfig.MailApiCC))
         {
             message.Recipients.Add(new Recipient(CoreConfig.MailApiCC, RecipientType.CC));
         }
         if (!string.IsNullOrEmpty(CoreConfig.MailApiBCC))
         {
             message.Recipients.Add(new Recipient(CoreConfig.MailApiBCC, RecipientType.BCC));
         }
         message.ShowDialog();
     }
 }
예제 #5
0
        /// <summary>
        /// Helper Method for creating an Email with Attachment
        /// </summary>
        /// <param name="fullpath">Path to file</param>
        /// <param name="captureDetails"></param>
        public static void SendImage(string fullPath, ICaptureDetails captureDetails)
        {
            string          title   = FilenameHelper.FillPattern(conf.MailApiSubjectPattern, captureDetails, false);
            MapiMailMessage message = new MapiMailMessage(title, null);

            message.Files.Add(fullPath);
            if (!string.IsNullOrEmpty(conf.MailApiTo))
            {
                message._recipientCollection.Add(new Recipient(conf.MailApiTo, RecipientType.To));
            }
            if (!string.IsNullOrEmpty(conf.MailApiCC))
            {
                message._recipientCollection.Add(new Recipient(conf.MailApiCC, RecipientType.CC));
            }
            if (!string.IsNullOrEmpty(conf.MailApiBCC))
            {
                message._recipientCollection.Add(new Recipient(conf.MailApiBCC, RecipientType.BCC));
            }
            message.ShowDialog();
        }
예제 #6
0
 /// <summary>
 /// Adds a new recipient with the specified address, display name and recipient type to this collection.
 /// </summary>
 public void Add(string address, string displayName, MapiMailMessage.RecipientType recipientType)
 {
     this.Add(new Recipient(address, displayName, recipientType));
 }
예제 #7
0
 /// <summary>
 /// Adds a new recipient with the specified address and recipient type to this collection.
 /// </summary>
 public void Add(string address, MapiMailMessage.RecipientType recipientType)
 {
     this.Add(new Recipient(address, recipientType));
 }
예제 #8
0
 /// <summary>
 /// Creates a new recipient with the specified address, display name and recipient type.
 /// </summary>
 public Recipient(string address, string displayName, MapiMailMessage.RecipientType recipientType)
 {
     Address = address;
     DisplayName = displayName;
     RecipientType = recipientType;
 }
예제 #9
0
 /// <summary>
 /// Creates a new recipient with the specified address and recipient type.
 /// </summary>
 public Recipient(string address, MapiMailMessage.RecipientType recipientType)
 {
     Address = address;
     RecipientType = recipientType;
 }
예제 #10
0
 /// <summary>
 /// Helper Method for creating an Email with Attachment
 /// </summary>
 /// <param name="fullpath">Path to file</param>
 /// <param name="captureDetails"></param>
 public static void SendImage(string fullPath, string title)
 {
     MapiMailMessage message = new MapiMailMessage(title, null);
     message.Files.Add(fullPath);
     message.ShowDialog();
 }
예제 #11
0
 /// <summary>
 /// Helper Method for creating an Email with Attachment
 /// </summary>
 /// <param name="fullpath">Path to file</param>
 /// <param name="captureDetails"></param>
 public static void SendImage(string fullPath, string title, bool deleteFileOnExit)
 {
     MapiMailMessage message = new MapiMailMessage(title, null);
     message.Files.Add(fullPath);
     message.ShowDialog(deleteFileOnExit);
 }