Click here to Skip to main content
15,886,689 members
Everything / Email

Email

email

Great Reads

by JosipK, Marko Kozlina
C# and VB.NET console applications that demonstrate how to create and send an email reply with IMAP and SMTP protocols in .NET Framework
by DataBytzAI
Easy way to send email on Azure with no mail server, using DNS MX and SMTP
by bbirajdar
How to embed an image in email body
by Afzaal Ahmad Zeeshan, Iqra Ali
Since I wrote an article previously, I had been asked on various occasions to share the code on Yahoo! or Bing, etc. I wanted to write an article, with the code, which covers all of those vendors as well.

Latest Articles

by Chris_Green
It all started with an email sent to a daemon.  A windows service hosting two modules, each of which monitors an inbox for automation, dutifully ignored warnings from IT that basic authentication for O365 would be switched off in several months. This is how we solved it.
by Marijan Nikic
A simple solution using Powershell for preparing emails from Windows batch in Outlook; supports HTML body
by Peter Huber SG
A WPF TextBox which can validate email addresses depending on your needs, plus detailed description of the many ways a valid email address may look like.
by DataBytzAI
Easy way to send email on Azure with no mail server, using DNS MX and SMTP

All Articles

Sort by Score

Email 

15 Jun 2016 by JosipK, Marko Kozlina
C# and VB.NET console applications that demonstrate how to create and send an email reply with IMAP and SMTP protocols in .NET Framework
4 Feb 2018 by DataBytzAI
Easy way to send email on Azure with no mail server, using DNS MX and SMTP
3 Dec 2013 by bbirajdar
How to embed an image in email body
8 Aug 2017 by Afzaal Ahmad Zeeshan, Iqra Ali
Since I wrote an article previously, I had been asked on various occasions to share the code on Yahoo! or Bing, etc. I wanted to write an article, with the code, which covers all of those vendors as well.
31 Jul 2012 by Shuqian Ying
The source code and a simple demo program for a plug-in in Microsoft Managed Extensibility Framework (MEF) that provides visual display of email messages.
12 Apr 2013 by NightWizzard
...for example a WYSIWYG HTML editor to edit or display emails...
3 Mar 2017 by Dracula
Run all rules for all accounts on all messages; also useful as Outlook Rule debug tool.
29 Sep 2012 by Ed Nutting
Hi there,If you are viewing the email in any decent email client then it will block the use of iFrames unless the suer specifically allows it. Sending HTML emails (especially ones with JavaScript and iFrames) is a very bad idea. 2 reasons: 1) It's unfriendly to users and a common thing for...
1 Mar 2011 by Klae
Is there, or can there be an RSS feed duplicate of your Daily Insider email? I love your daily email its great, sometimes at work I'm dealing with so much expletives that I don't get time to read it. Love to read it on my phone or something on the way home!
19 Aug 2011 by Wonde Tadesse
Use LinkedResource[^] class to embed an image to your email.
5 Dec 2014 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
Refer - Cannot get email to work with GoDaddy email SMTP[^]. Implement this.Quote:SymptomsUsing GoDaddy SMTP server smptout.secureserver.net email errors occur such as: Mail Error occurred - Exception=Failure sending mail. Unable to read data from the transport connection:...
27 Oct 2010 by Hiren solanki
Definitely you need to use Ragex pattern matching with that.consider this Email Regex pattern.[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}take a look at my sample.ArrayList list = new ArrayList(); string TestString = "From: Mabel Garcia From:...
5 May 2011 by fjdiewornncalwe
A quick search of CP articles showed this article. Although it is written in dotNet 1.0, I believe this code can be ported to any version of dotNet reasonable quickly. At minimum this article will give you a starting point with regards to approaching this.A POP3 Client in C# .NET[^]
7 May 2011 by Richard MacCutchan
See here[^] for specification of .eml files, and see here[^] for .msg format. You may find it easier to use the Outlook object model to create the .msg file (search MSDN for details).
4 Oct 2011 by Simon Bang Terkildsen
Mouse over your name in the top right corner then it's My Settings -> Newslettersand for notifications it'sMy Settings -> ForumsIf you're still not able to do get it to work you should poat this on the Site Bugs / Suggestions[^] forum, as you can't be sure that any of the CP staff sees...
12 Oct 2011 by OriginalGriff
When you send the mail yourself using C# code, you are not involving Outlook in any way - so it never gets the chance to copy it to the "Sent Items" folder. Outlook is just a mail client - just like your program - it leave the actual send up to your email provider. You could (probably, I've...
30 Nov 2011 by Wonde Tadesse
Two things that you need to consider while sending an email with attachment.1. The file that is going to be attached has to have read permission. You already discussed with Naerling.2. The size of the file has to checked against the actual size permitted to process by IIS worker process....
9 Jan 2014 by Sergey Alexandrovich Kryukov
Please see the comments to the questions, Ron's and mine. Please see my past answers for some further detail:i already encrypt my password but when i log in it gives me an error. how can decrypte it[^],Decryption of Encrypted Password[^],storing password value int sql server with...
4 May 2014 by TarikHuber
A class for sending emails with Outlook using the default Outlook Account. It includes adding multiple attachments and recipients and choosing to use the default email signature or not.
14 Jul 2015 by F-ES Sitecore
You need to speak to whoever administers the smtp server you are using and ask them what you need to do to allow relaying, or to configure relaying as possible from internal servers. Basically the problem isn't your code, it is configuration.
25 Aug 2015 by Wendelius
Did you try to find any code? Simple Google search[^] returns over 3 million hits...To mention a few:- Sending an Email in C# with or without attachments: generic routine.[^]- Sending emails over .NET framework, and general problems – using C# code[^]
2 Jul 2016 by Six Hat Solutions
Easily Send Emails From Your Microsoft Applications Using VBA and the SendGrid API
24 Jan 2018 by Hemang Maradia
How to send email from SQL Azure database through Azure PaaS services Logic Apps and SendGrid
22 Dec 2020 by Marijan Nikic
A simple solution using Powershell for preparing emails from Windows batch in Outlook; supports HTML body
25 Oct 2010 by Sandeep Mewara
Hi,Things/...
31 Oct 2010 by Keith Barrow
For technical problems regarding this site, there is the site bugs and suggestions forum: http://www.codeproject.com/Forums/1645/Site-Bugs-Suggestions.aspx[^]The Q & A is for technical questions. It looks like others are having the same problem.
1 Mar 2011 by Richard MacCutchan
You should post this question to the Site Bugs/Suggestions[^] forum.
15 Mar 2011 by Albin Abel
If you going to use PHP then their manual is the starting pointhttp://php.net/manual/en/book.imap.php[^]http://www.phpclasses.org/package/2351-PHP-Access-IMAP-mailboxes-without-PHP-IMAP-extension.html[^]If c# enough examples...
27 Mar 2011 by Wendelius
Try changing the BodyEncoding[^] property.
18 May 2011 by Simon_Whale
Using the article below, You download the POP3 ID's associated with the email and use that to download / delete from the accountCodeProject Article: Qmail client[^]
16 Aug 2011 by mnd017
Hi, so, I need to read all emails from email server (public, free, web provider), with POP3. I use OpenPop library (I do some research, and still not sure about that choice). Received emails I want to save in my database. To identify, whether email already is in database i want to use...
10 Sep 2011 by Sergey Alexandrovich Kryukov
Normally, every member receives e-mail notifications related to all posts. Just check up your preferences at https://www.codeproject.com/script/Membership/Modify.aspx[^].—SA
4 Oct 2011 by Tee Tom
How do you unsubscribe from all the emails that The Code Project sends?I attempted to use the link at the bottom of the email, but when it takes me to the unsubscribe link, I'm mis-identified and I don't get unsubscribed.
4 Oct 2011 by Mehdi Gholam
Multi part mime messages are automatically created when you add attachments to your mail.Read the following links :http://www.systemnetmail.com/faq/3.1.3.aspx[^]http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/660b744d-59c1-4d59-b513-cc57d1a7385e[^]A POP3 Client in C#...
4 Oct 2011 by Sergey Alexandrovich Kryukov
Just click here: https://www.codeproject.com/script/Membership/Modify.aspx[^].—SA
30 Nov 2011 by wonder-FOOL
Hello dear CPers,I have a web form which functions like a email compose message and send it. I have To,CC, Body area. In addition to them, I have a checkbox where I am having my problem. When user checks this checkbox it supposed to find a file under a specific folder and add a file to the...
21 Dec 2011 by Wendelius
Have a look at: How to: Use the Email Compose Task for Windows Phone[^]
29 Jan 2012 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
You have to add the following codes to send a mail as simple as possible... [Example is given for gmail account. That means you have to have one gmail account to send a mail to any address.] string pweda = "FromMailPassword"; //(ConfigurationManager.AppSettings["password"]); ...
12 Mar 2012 by #realJSOP
The only way you can verify that an email address actually exists is to send a verification email to that email address that requires the user to click a verification link that will then update the database to indicate that the address has been validated by the user.
19 Jun 2012 by OriginalGriff
Don't post this here - you need to talk directly to the admins.Post it in the Sugs & Bugs forum[^] instead - it may be a bug with the auto emailing (or finger trouble on your part!), but the admins have access to your login details, we don't.
28 Nov 2012 by satrio_budidharmawan
Hi guys,I wanna ask on how to create spoiler in email. I use mozilla thunderbird.Here's the code i've tried : Spoiler Content Here
26 Apr 2013 by KM Perumal
Thry this client.Host ="smtp.live.com "; client.Port =587; client.EnableSsl = true;
22 Jul 2013 by Ron Beyer
Quote:Message would bring account over daily quotaGet a mailbox with a bigger quota.[Edit]Here's a prime example of getting an error and jumping to a conclusion without understanding the error itself. Taking the time to read the error can point you directly to the problem (over daily...
21 Sep 2013 by V.Lorz
Some times it's a good idea trying to get some background about what you're willing to do. For downloading e-mails from the server you use what is called e-mail protocol. Two of the most commonly used ones are POP3 and IMAP. With this in mind you can go and search for something like "pop3 client...
23 Sep 2013 by Sergey Alexandrovich Kryukov
"Extract" probably mean parsing of raw mail, which is actually a plain text with MIME mail parts, encoded in different ways, usually base64 (if any). This open-source implementation may help you:http://hpop.sourceforge.net/[^].Not only it can be used as a POP3 client, but also to parse raw...
11 Oct 2013 by ASP.NET Community
Following Codes demonstrates how to send an email with SMTP Authentication using ASP.NET 3.5using System.Net.Mail        MailMessage msgMail =
29 Dec 2013 by Sergey Alexandrovich Kryukov
Because "bulk e-mail" is actually the spam. You cannot do anything about it. If some of your recipients think that this is spam (and probably even report it as spam), it is spam. Do you have a written consent from those recipients to accept your information? If you have, this is not spam,...
9 Jan 2014 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
Refer my answer - sending email to gmail from asp.net[^].This works pretty good. Tested.If you are getting any Exception, please reply me with that. I will, help.
3 Nov 2014 by Richard Deeming
The only way to provide the user's GMail credentials would be to ask the user to enter them. Any user with an ounce of common sense wouldn't enter their GMail credentials on a random website, so I don't think that's going to work. :)You need to provide the credentials of your own GMail...
10 Feb 2015 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
You cannot do like that, email clients won't allow you to do so. You have to open your page in new Tab and do the task in the page load of that page.
20 Mar 2015 by manchanx
1) You need the email-addresses of your users - you probably already have them.2) When clicking on a user name or as an option in a users profile a form for writing a message to that user should be accessible.3) When the user confirms to send the message, you send it to the recipients...
7 Jul 2015 by Suvendu Shekhar Giri
This is because you passing just a string to the SmptpClient.Send() method.This method has two forms i.e, it has one overload. The first form takes 1 parameter of type MailMessgae and this is what you have used in your code. You need to have following information1. from (email id), 2. to...
24 Mar 2016 by Sascha Lefèvre
Your connection string is meant for Entity Framework. SqlConnection would require a different one. But as your project is an Entity Framework-project I see no reason why you would want to bypass Entity Framework here. You actually do initialize an EF-DBContext with that using-Directive at the...
17 Jul 2016 by Andy Point
Firebase Android Tutorial : Adding Registration and Login Hello Developers, this is our android firebase tutorial. In this tutorial we will create an android firebase app that will use firebase android login functionality. This post will help you get you up and running with integrating Firebase to a
26 Mar 2017 by OriginalGriff
Sending without a password is a function of the email host you are using, not of your application - other than "don't provide a password" or "use a blank password" in your app. If your email host requires a login then you have to provide a valid username / password combination (even if the...
2 Jun 2020 by OriginalGriff
Normally, I'd address the mail to a "noreply" email address on my domain and attach all genuine recipients as BCC addressees, rather than trying to add them as "To" addresses. That way, each recipient does not receive a list of every other...
3 Jun 2020 by MadMyche
The MailMessage.To property is not a string value; it is actually a collection of email addresses To add to this collection; you generally would use the Add() method, just like you did for the first recipient.msg.To.Add(new...
7 Aug 2010 by M.Hendrix
You have to wait for SMTP to finish sending the email and its attachment.After that you should Dispose the MailMessage object and then the attachment is unlocked.So:SmtpClient oSmtp = new SmtpClient();//set propertiesMailMessage oMail = new MailMessage();//set...
27 Oct 2010 by Abhinav S
Have a look at this[^] article.
10 Dec 2010 by AsthanaP
Hi,I am trying to create an application for sending Email from titanium developer applicationb.addEventListener('click', function() {var emailDialog = Titanium.UI.createEmailDialog();emailDialog.subject = "Hello from Titanium";emailDialog.toRecipients =...
12 Jan 2011 by jerrykid
Maybe this link will help youhttp://en.w3support.net/index.php?db=so&id=80653[^]
18 Feb 2011 by RavindraMaurya
Sir, I wanted to send email in in asp .net 3.5 with C#. I have implemented the following code:System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage(); mail.To.Add("taannmay@gmail.com"); mail.To.Add("toemail@yahoo.com"); mail.From = new...
22 Feb 2011 by Tech Code Freak
I want a functionality to send automatic email to any gmail/yahoo/rediffmail/......... account from my website which is on my local machine. Please help me with the coding as well as server settings if any. Have added using System.Web.Mail;I have added a button on whose click, the...
22 Feb 2011 by Sandeep Mewara
It can be because of various reasons. You need to look at them one by one.Is the port open? Firewall permissions in place?Further make sure you have configured SMTP configuration in Web.Config:
24 Feb 2011 by Krunal Berawala
Hi Guys,I have requirement i have to remind people that their licence is expiring in next 2 months. While creating the profile i record their certifiate expiry date, users may be around 1000 +.* Every week once system should get the list of users who's licence is expiring and send...
29 Apr 2011 by Troy Murphy
Is is possible (using code to query) to embed a small piece of text into an email message that will persist with the message but not be visible or changeable (perhaps in the header or something)? It needs to persist and be retrievable from the Sent folder in Outlook. FYI: We use a...
29 Apr 2011 by Sergey Alexandrovich Kryukov
In principle, absolutely everything in the e-mail is both visible and modifiable. E-mail related standards are notoriously ignorant about any kind of protection against any kind of forgery. All you can do is encryption.However, you can hide some data (such as something you want to process as...
28 May 2011 by #realJSOP
It's probably because your email server doesn't allow relays.
8 Sep 2011 by Mehdi Gholam
Take a look at the following:How do I receive an email in c#?How do I send mail using C#?CodeProject Article : A POP3 Client in C# .NET
13 Sep 2011 by Gsalles
How can I embed Images on messages to Hotmail users ?I tried this one (below) and it works well for Yahoo users.How can I do it works for Hotmail users ? MailMessage MsgTorp = new MailMessage(pOrigem, pDestino, pTitulo, pTexto); ContentType mimeType = new...
22 Sep 2011 by CodingLover
Edit the content with RichText, and enable the formatted text in the body.Could you provide more details by the time, about your application. Email application can be developed in many ways, and we don't know what you have done really.
14 Nov 2011 by clientSurfer
Hi CPians,I'm trying to find either a free web service with which I can validate eMail addresses programatically or some C# code that will allow me to do it myself.I've found a few good sites that will perform the full verification (syntax, domain, mailbox) for you but only in an...
14 Nov 2011 by Rob Philpott
No specific answers, but in terms of syntax validation you can use regular expressions. You won't have to look far on the net to find stuff on this. To validate the email address is actually real, you can connect to the SMTP server which handles the account. Use an MX lookup to determine the...
21 Dec 2011 by coded007
Quote:mail.Fro...
22 Dec 2011 by coded007
look over this http://www.astahost.com/info/tilffm-sending-mail-net.html[^]
13 Jan 2012 by OriginalGriff
See here, it gives a generic email method: Sending an Email in C# with or without attachments: generic routine.[^]All you have to do is read the data from your fields, and pass that as the "body" parameter along with the other necessary parameters.
13 Jan 2012 by Om Prakash Pant
pl check the sample code in the following thread:http://www.java2s.com/Code/ASP/Components/SendoutemailincodebehindC.htm[^]also see the following thread if you want to use Gmail for sending emails:http://www.daniweb.com/web-development/aspnet/threads/287044"[^]
13 Jan 2012 by OriginalGriff
If you hash your users password (Yay! Well done!) then no, you can't retrieve it if they forget it.The normal way to handle this is to reset the password to a random string (I use a Guid, but you can use the GeneratePassword method[^]) and then email the new password to the users registered...
27 Feb 2012 by Espen Harlinn
Have a look at the wikipedia page for Microsoft Exchange Server[^]It should not come as a surprise that Exchange is pretty well integrated into the windows eco-system.Best regardsEspen Harlinn
15 Mar 2012 by El_Codero
Hi,you can change requestedExecutionLevel in your app.manifest file torequireAdministrator , but users have to accept dialog from UACDoes it work for you?Regards
27 Mar 2012 by Kortez2223
How to sent email (Yahoo! SMTP) with Silverlight 5 WCF RIA.
10 Apr 2012 by SamarRizvi
Use email authentication methods, such as SPF, and DKIM to prove that your emails and your domain name belong together, and to prevent spoofing of your domain name. The SPF website includes a wizard to generate the DNS information for your site.Check your reverse DNS to make sure the IP...
27 Apr 2012 by joesamraj
//Code for sending a welcome mail for the registered user// add name space using System.Net;var smtp = new System.Net.Mail.SmtpClient();smtp.Host = "smtp.gmail.com";smtp.Port = 587;smtp.EnableSsl = true;smtp.DeliveryMethod =...
12 May 2012 by Sergey Alexandrovich Kryukov
In particular, please see:http://www.paulgraham.com/spam.html[^],http://www.paulgraham.com/better.html[^].—SA
15 May 2012 by Sander Rossel
This is actually pretty easy, depending on the version of Crystal you use.You need a ReportDocument[^] (which you probably have if you have a viewer) and use the ExportToStream[^] function.Now simply pass the Stream[^] to the constructor of an Attachment[^].Other than that you can simply...
16 Jun 2012 by OriginalGriff
If no changes are making a difference, then you need to check that you have published the code to the right place, and in the right format.At the moment, it sounds like your code changes are not being transferred to your server at all.
28 Jun 2012 by OriginalGriff
You can't send a windows form in any format that can be executed directly by the client, unless you attach it as a standalone program. Which is unlikely to be opened, and may well cause the whole message to be considered as spam by many filters.You can send the form as "straight" html, but I...
21 Sep 2012 by Sergey Alexandrovich Kryukov
I'm too lazy to find a bug; after all, this is your problem.But I can see one vulnerability, which is practically much worse than the bug. With the bug, you just fail to send a e-mail. But if you fix the bug, the vulnerability can be used to turn your computer into a zombie sending viruses...
30 Sep 2012 by OriginalGriff
Look in the top right of any page - then hover the mouse over your Username.From the drop down list, select "My Settings"In the page that results, click the "Forums" tab.Under "Default Post Options" you will see "Send me an e-mail if someone replies to the message" - tick it.Press the...
3 Nov 2012 by Jason Gleim
You can't do this. You can lookup the MX record for the domain but that is the inbound mail exchanger and, quite simply, it won't accept mail from your program. If it did, every spammer in the world would do what you are asking to do. Mail servers (like GMail, Yahoo, etc) want things like...
6 Mar 2017 by rupeshsha8452
I am trying to send mail email asynchronously from c#, but there is not giving error and also not sending email to the given mail id. Here what I am using code :-In this code when I send simple mail it works fine. public void SendMailAccro(int SlNo, string EmailId, string Body) ...
11 Dec 2012 by kk2014
actually in my above code i commented throw ex;. so i uncomment it and wrote below code to raise error.System.Windows.Forms.MessageBox.Show(ex.Message.ToString());throw ex;and i found it throws error :the request failed.unable to connect to remote server.actually my exchange...
13 Dec 2012 by Avinash6474
Hi All,I am sending an email to members from C# console application. I want to show images in email. I am having the images in Base64String format.I tryed with following code but it is not working. The image is not displaying in...
15 Dec 2012 by gaga blues
Richard MacCutchan mentioned that it might be in the spam. Actually, everything are transferred there so my case is now closed. Thanks Richard MacCutchan!
24 Dec 2012 by Thomas Daniels
Hi,Have a look here:Creating In-Memory Mail Attachments[^]In the article, there's text converted to a byte array, but you can do that also with an image:C# Image to Byte Array and Byte Array to Image Converter Class[^]
24 Dec 2012 by jschell
It isn't clear if you want to send via gmail or you want to use another smtp server.To send to any server you must match the protocol expected by the server. If you don't match it then it will fail.If you want to use gmail then googling suggests that your code is incorrect (incomplete.)
2 Jan 2013 by Josh Hawley
The server is not "muppets.com". That is their domain name. You have to do a DNS look up to get the MX records for muppets.com and then use those MX records to get A record(s) for their mail server(s).You can do this manually using nslookup (Easily done with code as well):Default Server: ...
8 Jan 2013 by Manas Bhardwaj
User credentials for SMTP server serves no purpose more than to authenticate while sending an email. It ensures that noone with proper credentials could send an email via the server.And, this has no relation to the delivery receipt.
1 Feb 2013 by Dee_Bee
Hi all,I tried with fileUpload and found the solution. mail.Attachments.Add(new Attachment(fileUpload.PostedFile.InputStream, fileUpload.FileName)); Thank you all