Click here to Skip to main content
15,891,864 members
Articles / Desktop Programming / System

Using Gmail Account to Send Emails With Attachment

Rate me:
Please Sign up or sign in to vote.
4.75/5 (6 votes)
5 Apr 2011CPOL 16.8K   4  
public class MailClass { public static void CreateMailAddresses(string sender, string reciever, out MailAddress mailfrom, out MailAddress mailto) { MailAddress Mailfrom = new MailAddress(sender); MailAddress Mailto = new...

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
26 Sep 2013dontumindit 4 alternatives  
Sending Email using Gmail account from your application.
Please Sign up or sign in to vote.
8 Apr 2011BillHudson
Man, that works great! I just converted it to VB.NET and also showed the Imports/Using that was needed, thanks to David's alternate. This was just what I was looking for, Thanks Abdur.Imports System.NetImports System.Net.MailPublic Class frmMain Private Sub frmMain_Load(sender As...
Please Sign up or sign in to vote.
18 Apr 2011charles henington
Sending mail with attachmentspublic partial class Form1 : Form { public Form1() { InitializeComponent(); } public class MailClass : List { public void CreateMailAddresses(string sender, string reciever, out...
Please Sign up or sign in to vote.
29 Mar 2011SouthernILCode
Hello Abdur,Helpful article on using Gmail to send mail. Added the following "using" statements to my code:System.Net for NetworkCredentialSystem.Net.Mail for MailMessage and AttachmentSystem.IO for adding a OpenFileDialogAlso modified my code to send with...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
I do not claim to be wrong! I just rarely ever write.

Comments and Discussions