Click here to Skip to main content
15,893,381 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 Title

Email 

24 Dec 2012 by marcel zol
I need to add image as attachement from list not from disk.Image from list:List listImage = new List();i` added the images to this list.Image to add as attachement is:listImage[1]add as attachement to... = new System.Net.Mail.Attachment(...i`ve tried...
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[^]
12 May 2014 by AR547
I have a Gridview, in which i am using Fileupload Control as an item template.there are max 6 rows can be generated in this gridview.As I am sending this gridview to email after converting to HTML I WANT TO SEND THOSE FILEUPLOAD FILES AS AN ATTACHMENT WITH THIS EMAIL. THE GRIDVIEW WILL BE IN...
23 Sep 2013 by muhammadwaseem
why don't you use attached file property for detail follow the link http://stackoverflow.com/questions/13553242/how-to-attach-multiple-files-to-the-email[^]for file uploader why you use gridview actually am not understand your problem will you plz explain in detail what you want...
12 May 2014 by AR547
I have a GridView in my web application. Having 9 Columns. I just need to send the detail of 6 columns from it through email. What will be the accurate procedure of this issue. Also how I will convert those column into HTML format.... Please Help.
17 Sep 2013 by Ashishmau
You can take you gridview into datatable and then you can remove n number of columns using dt.column.remove(columnname) something like that and then you can convert your datatable to htmltable by using function given in below link and then send this html table in you...
19 Sep 2013 by Diana Tsax
First step: convert gridview to html table and remove the columns you don't want private string getHTML(GridView gv) { this.OrderGridView.AllowPaging = false; this.OrderGridView.AllowSorting = false; this.OrderGridView.EditIndex =...
19 Sep 2013 by Murali0195
Hi...See this. May its useful to u.//Reads values from ur gridview1.GridViewRow gvRow = (GridViewRow)(sender as Control).Parent.Parent;//assigning gridview1 controls to strings like blow.string username =...
19 Sep 2013 by AR547
THERE ARE TWO TABLES WHICH I AM SENDING TO EMAIL.• HTML TABLE - GETTING VALUES OF MY SERVER CONTROLS IN THE HTML TABLE• GRIDVIEW - AFTER CONVERTING IT TO HTML.SENDING THE HTML TABLE AND GRIDVIEW(HTML FORMAT) TO EMAILprivate void emaildatatable() { string reqini =...
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.
3 Oct 2013 by alex giulio
please help me! i couldn't find it when search on website with a problem:how am i able to know that receivers have read, deleted, unsubcribed mail sending for them. for example: when i send a mail with any content then receiver can read or not, can delete it, or denied it. so, what must i do...
3 Oct 2013 by OriginalGriff
You can't in practice.You can ask for a read receipt, but that request has to be honored by system which is reading the email, and some don't. Of those that do, most inform the user and ask for permission before responding.The problem is that too many spammers used various ways to identify...
3 Oct 2013 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
Please check my answer - Track Email - Get Response when Email is Read[^]You can follow this technique to know whether user has read your email or not.But it's success rate is not 100%. Still you can try, if you like it.
27 Mar 2011 by MarqW
Hi, I've a segment of code which combines the HTML signature from Outlook into an email settings (Code below).However, when the string contains accentuated characters (ie, é), the emails sent through the .NET Mail objects replace them with the "?" character. Is there anyway to retain the...
27 Mar 2011 by Wendelius
Try changing the BodyEncoding[^] property.
30 Sep 2013 by Pratik31.J
Hello,I have a requirement where I want to create system that will accept the emails, update(secure contents and attachments) and send it.The user can add receipient's address like: someone@example.com.secure.comwhere, secure.com is my server which will accept the emails, update it and...
30 Sep 2013 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
If you want to develop this type of application, then you need to research for that. You can also contact with their developer team to get some idea.As per my knowledge, you can read the new emails by POP[^] protocol.Then in your software, modify it by getting all the Email's properties...
16 May 2015 by Member 11694588
Reworded to make a little more sense...Reposted:http://www.codeproject.com/Messages/5059308/Code-Project-User-Account-Silent-Login-Fail-Confli.aspx[^]When I try to sign into Code Project it takes me straight back to the page I was at, doesn't sign me in, and doesn't report an error.I...
15 May 2015 by OriginalGriff
If you mean this site (rather than one you created) then you need to bring this to the attention of the staff. Post this here: http://www.codeproject.com/suggestions.aspx[^] and they will see it (posting in QA they aren't likely to, QA cycles pretty fast most days, and nobody reads every post...
19 Aug 2014 by Jinan Kordab
This article describes how to create or delete an Active Directory Services Email using ASP.NET web page, remotely.
31 Oct 2011 by JawadHafiz
I want to retrive image from SQL and send it in email.AlternateView htmlView = AlternateView.CreateAlternateViewFromString(message.Body, null, "text/html"); LinkedResource logo = new LinkedResource(Server.MapPath(".") + @"\",...
31 Oct 2011 by kiran dangar
Hi, as you want to use ASHX Handler this article might server the purpose...http://kirandangar.wordpress.com/2009/12/01/storing-and-retrieving-images-into-sql-server-2005-using-large-value-data-type-and-http-handler/[^]Hope this will help you solving the problem...
30 Nov 2020 by Member 13541763
I am working on an application, our process is that when a new user signs up, s/he is added to list(contact list of email service provider) with tags like 'New', 'Trial User' etc, to easily identify user status and send them emails accordingly....
30 Nov 2020 by Yvan Rodrigues
All major providers require confirmation to comply with anti-spamming laws. If you operate your own server, most mailing list software will allow you to do what you are trying to do, such as GNU Mailman, LISTSERV, Majordomo etc.
14 Jul 2011 by Member 4301939
Hi All, I need to create an outlook add-in using .net 3.5 framework. Requirement includes adding a dropdown control in email's body part. This drop down will be bound from a datasource. My question is - Is it possible to add a control in email's body part using .net? If yes then...
14 Jul 2011 by Sergey Alexandrovich Kryukov
The control itself is not a problem — use MIME type "text/html" for the whole e-mail or e-mail part (in this case, Content-Type: multipart/alternative) and add a control to HTML text. But data binding cannot be used in this case, as the source of HTML code is not the HTTP server where you...
13 Feb 2014 by dash2020
Hi allI have a datagrid where I am showing contact list of our people with their individual email address/s. I have added a checkbox.I want to check if outlook new message is open if it is open then add all selected email address (datagrid cell value) to the BCC field.Here is my...
20 Nov 2018 by itsathere
I am able to attach image in email attachment but unable to attach image inside anchor tag with link.>
12 Oct 2015 by ZurdoDev
Most email clients will block image downloads so it isn't that your code is wrong, it's that the client email is blocking it. You can't do anything about that. The client needs to choose to download the image.
28 Oct 2015 by Cyrus_Vivek
Hi,.login { background: url(../img/user.png) no-repeat 6px center; width: 100px; height: 100px; display: block;}Or,Follow the link for more...
25 Sep 2014 by write2varun
Hi, I have a situation where i need to add a textbox inside a email, i added a html textbox in the email. If i open the mail in the web browser it is working fine but when i open the mail in outlook it come like "[ ]" i need to make this text box editable so that i can add some values to...
28 Sep 2014 by Sibeesh KV
Basically outlook does not render or support html controls .Please read the alternative here : http://msdn.microsoft.com/en-us/library/office/aa338201%28v=office.12%29.aspx[^]
8 Mar 2016 by cybertaz
I 'm trying to add function to the send email button that modifies the email address and the subject but have been running into a weird issue. If I run debug and step though the code it works but if I let the code run the email is sent out with no recipients.I've added msgbox before...
29 Mar 2012 by eduphilic
i want API, Code, Widgets in .jsp for sending invite to other email user like(yahoo, gmail) from my website. please help
28 Mar 2012 by Not Active
I'm sorry Google is broken. SmtpClient[^]
26 Dec 2011 by aounali
hello awl..i 've developed and aap which sends email through the windows phone 7 plateform...i want to run that app on the background of the screen...means to say it should be invisible to the user that this app is running on his mobile so plz help me what should i do????
29 Dec 2011 by Andrew Piotrowski
Ok. I have used this in my app :#region private members bool runsUnderLock; bool isRunningUnderLock; bool hasUserAgreedToRunUnderLock; bool isRestartRequired; #endregion #region public properties public bool RunsUnderLock { ...
18 Jul 2011 by mihirmwd225
If Any one Knows or Any one Developed a System to send a mail using my Yahoo ID to some of my Friend & Also with Attachment in VB.NET.....PLZZZZ HELP
18 Jul 2011 by Abhinav S
Check this[^] out. Maybe it can help you.
5 Jun 2011 by Mubeen.asim
my email signature contains a table with a static random quote but i want to make the quote dynamic so that i can call a handler which will return a dynamic quote string from the database.but am confused how to do it cause when i write the handler address in the ...
5 Jun 2011 by RakeshMeena
It should look something like this:''
15 May 2015 by Emm4
Goof Afternoon,I'm new to coding and need some assistance, I'm going to make this as easy as I can to understand.Basically I want to be able to input data into a page and write that to an accessdb which I've managed to do using a submit button, but I am also wanting to email that...
15 May 2015 by Afzaal Ahmad Zeeshan
Sending an email is different in both frameworks (.NET framework and ASP.NET framework), although the code of .NET framework would on ASP.NET too, but ASP.NET has a personal implementation of email sending frameworks and objects. You simply need basic understanding of the SMTP protocol, how...
15 May 2015 by ArjunBhalodiya
ASP.Net uses System.Net.Mail namespace to send mail using smtp mail server so First of all you need to import System.Net.Mail namespace. Then put below code to your project. try { MailMessage mailMessage = new MailMessage(); //MailMessage...
27 Aug 2022 by Member 13378958
my site name exmaple.com need any one mail send admin@exmaple.com not gmail configration need only exmaple.com coding What I have tried: asp email send
27 Aug 2022 by Richard MacCutchan
asp email send - Google Search[^]
30 Jul 2012 by Ndamulelo Savhase
I'm working on a project, the main goal of which is to generate a PDF to be generated and sent as an Email attachment.A User Logs in/Registers..., then answers a set random of questions, and submits the answers.The user is redirected to an asp page after this, which has the results as they...
30 Jul 2012 by woutercx
An article about working with images and iTextSharp:It's about putting images at certain positions in a pdf with C#.But couldn't you have found it using Google?http://www.mikesdotnetting.com/Article/87/iTextSharp-Working-with-images[^]About the other question you had: this pdf doc...
30 Jul 2012 by Rene Bustos
Hello .Recently i develop a web service that generate a PDfthe first step is to load an image in png format with graphics class . then write the datagridview data over the png . and then load with itextsharp the image (bytes) and save in pdf format .This way is very very good cause the...
29 Nov 2010 by NetMan2012
Hello,I am working with 1and1 hosting company and its been a strange issue. I am sending email and passing html script to body. It works fine and html body displayed when i check email on 1and1 webmail account but when i send the same email as cc to some other servers like gmail, hotmail...
29 Nov 2010 by A.Ayyappa
I hope it will use for u...public void btnSend_Click(object sender, EventArgs e) { MailMessage MyMailMessage = new MailMessage(); MyMailMessage.From = new MailAddress("fromAddress", "Display Name", System.Text.Encoding.UTF8); ...
9 Apr 2015 by Parvathaneni Mamatha
How to use Razor Views as Email Templates and Localize them using sample WebAPI
16 Aug 2014 by Yesudass Moses
HiI am an absolute beginner in android development. I am making a small email application. What I want to do is: when I click on any email in web browser, My application should be used to open this email. Now My phone shows only gmail, Drive, and Email only. How can I add my application too...
10 Mar 2023 by Gcobani Mkontwana
Hi Team I am attaching pdf on my html content, but its not loading to open and need some help around, i experience this issue What I have tried:
11 May 2022 by Haifovchanin
The application may access the same mailbox from two different computers and retrieve unread emails. I'd like to change mail status to Read immediately on mail retrieving to avoid downloading the same email to multiple stations. What I have...
11 May 2022 by Dave Kreskowiak
That's not how an email server works. You cannot guarantee both machines will NOT get the same email. No, you cannot download the emails and simultaneously mark them as read. While machine1 is downloading the emails, machine2 can be doing the...
10 Aug 2018 by Member 13945135
Working on a new email and in all testing/building platforms the background hero image shows up ... but when the code is put into the email platform (Braze, also known as AppBoy), the image does not show up. Here is the code: table width="600" style="background-color: #f5f5f5;...
10 Aug 2018 by OriginalGriff
It's quite possible that images don't show up because display of images is disabled by default in many email viewers - spammers, phishers, and so forth were using them to identify "live" email addresses so most disable it by default to prevent that. You could try embedding the image in the...
18 Sep 2017 by Gary Heath
I use VBA in Outlook for a lot of automation, but since Office 2007 I have had nothing but trouble with it. I just didn't like Outlook 2013 and am now trying Outlook 2010, but it's rejecting the VBA add-in as being invalid and just not running my programs. Are there any E:Mail programs that...
23 Jun 2015 by Aiden.JP
I'm trying to make this bash script dispatch and email when it detects that a certain type of file (files ending in ".gz"), which was last modified 24 hours ago, is below a certain size in a directory, I currently have it running on my entire computer. (I have it set to 10 kilobytes).It just...
23 Jun 2015 by Richard MacCutchan
It is some time since I wrote any bash scripts but I think you may need something like:#!/bin/bash# find all .gz files of 10k since yesterday, and count themcd COUNT = `find . -name "*.gz" -size -10k -mtime -1 -print | wc -l`if [ $COUNT -eq 0...
8 Nov 2016 by Bigprey
In one of my asp.net pages (C#), I am using a SMTP mail option. Everything works fine in the mail such as subject, To addresses etc except for the BCC to a default gmail address (I use this to verify how the mail end up at others mailbox).protected void SendEmail(string MemberName, string...
7 Nov 2016 by Midi_Mick
Your code looks good, so I would suggest that the bug is either in the MailMessage object, or in your e-mail server. You could track down which one by:1. Connect to your e-mail server using an existing e-mail client (thunderbird or similar). Send a message with a BCC, and see if the server...
8 Nov 2016 by Bigprey
I found the issue.Only the Gmail is not accepting BCC. I thought since "To" addresses has some including gmail ids & receiving mails, then it should also accept BCC.Anyway, I only thought of knowing how the mail gets shown up in other's gmail inbox. So, I can't find it through BCC method.
24 Nov 2015 by bjay tiamsic
Hi.I wonder if there is a remedy in sending out an email , if the record is blank. Then the email that is being sent is also blank. Seems like it does not complete the html code when a record is NULLDECLARE @EmployeeName nvarchar(150), @htmlBody nvarchar(max)=N'',@htmlheader...
24 Nov 2015 by Dave Kreskowiak
That depends on your code. Since you don't show any it's impossible to tell you what you're doing wrong.Besides, why that hell would you send a blank email?
16 Jan 2015 by Member 11380736
I have some c# code that creats a standard email and sends it through an exchange server.I have 6 textboxes in this mailform: from,to,subject,exchangeserver,user and password.If the user textbox is preset with the user info (found from mssql server) it won't send the mail. This...
16 Jan 2015 by Dave Kreskowiak
No enough information.Since TextBox.Text just returns a string, you just have to type "user1" (without the quotes) into your usertextbox and you get the exact same thing.The server is telling you that whatever you're doing isn't authorized, given the data that you sent.
16 Jan 2015 by Member 11380736
I solved it.The problem was that when the user id was found in the mssql database and writen to the bruger.Text it added some empty spaces. I think it's the .ToString();that did this.My solution was to write this line:bruger.Text = bruger.Text.Replace(" ", ""); ...
30 Apr 2013 by joshrduncan2012
Hi everyone!I am creating a forgot password screen for my application for users to reset their passwords. The program is then supposed to send emails with the updated password to the email account associated with the username. The current status is is that the program freezes when it...
30 Apr 2013 by Dave Kreskowiak
The code LOOKS correct, but without knowing the exception that's thrown, it's difficult to say.The network credentials must be a valid GMail login name.Your work server cannot lbokc access to the GMail servers (most corporate networks do!)You cannot use your GMail email address in...
16 Dec 2015 by ShelbyP93
Why does this code return False?Both Email Account Passwords Are The Same And I Own Them Both!internal static Boolean __send_email(String yourEmailHost,String usersEmailAddress, String userMessageSubject, String userMessageBody, String yourEmailAddress, String yourEmailAddressPassword,...
18 Dec 2015 by Member 12092254
Try Thisprivate void button1_Click(object sender, EventArgs e){ try { MailMessage mail = new MailMessage(); SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com"); mail.From = new MailAddress("someone@gmail.com"); ...
23 Dec 2015 by adriancs
Google Gmail login mechanism require more steps for it to works.It's either you implement their secure login procedure or disable secure login.Disable secure login is the simpler way but less security.About turn off secure sign in:Google may block sign in attempts from some apps...
23 Dec 2015 by Jiyaji_
MailMessage Msg = new MailMessage(); // Sender e-mail address. Msg.From = new MailAddress(mail id here); // Recipient e-mail address. Msg.To.Add(mail id); Msg.Subject = "Add Subject"; ...
20 Jan 2015 by Member 11380736
The solution was to download Managed API 2.1, install it, add to references and code it like this:ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);service.Credentials = new NetworkCredential("user", "password", "domain");service.Url = new...
8 Aug 2016 by diegoandrescamacho
C# codetry { ExchangeService service = new ExchangeService(); service.Credentials = new WebCredentials("mail@dominio.com", "pasw", "smtp.office365.com"); service.Url = new...
6 Oct 2015 by Member 11838485
Hi CPians,I am developing software for sending newsletters via e-mail to a list of addresses.the current release checks the syntactic correctness of the email addresses through a regular expression, but I need to integrate a real check on the existence of the email.Can you help me?...
6 Oct 2015 by F-ES Sitecore
You can't validate that an email is genuine. If genuine emails are important to you you'll need to send an email to the given address with a validation link. Also please do your own basic research before asking a question, there are a lot of articles concerning this already.
6 Oct 2015 by Maciej Los
There's no way to check if email exists in real, unless you send an email and you'll get a reply. ;)
6 Oct 2015 by phil.o
If, by "real check on the existence of the email", you mean actually validate that an email address really exists (and not only checking that it is well-formed), you may experience some hard times.Indeed, there exists a command in the SMTP protocol to check a domain for the existence of a...
22 Jun 2011 by Member 8023187
Hello,I have created a console application in c sharp. I want to print a particular type of content like (content type is text plain).How can I do this? The application is a pop3 server accessing mail. I want to do this because i want to remove email header from the text i am...
22 Jun 2011 by 2irfanshaikh
I think this Link[^] will help you.
22 Jun 2011 by Sergey Alexandrovich Kryukov
I'm not sure why you need to strip them, but the headers has simple format you can find here: http://www.ietf.org/rfc.html[^] by RFC numbers 2045 to 2049.Basically, each header goes on a separate line with possible continuation lines. An empty line signals that comments are finishes and the...
29 Aug 2013 by DragonetLi
Recently,I try to write a program about receiving email.First of all,I received a email subject(wrote with English) is very successful,but if the email subject wrote with Chinese,I only get some messy code(I think it's messy code,because I don't know how to convert),please help...
18 Apr 2011 by Sergey Alexandrovich Kryukov
To send the e-mail advertisements, a person should first turn a dirty shameless no-mercy criminal.(I do not CodeProject members can provide any help here.)—SA
18 Apr 2011 by Joan M
You should clarify your question:A) do you want to create an advert for CP? and you don't know how to make it?B) do you want to be able to make massive mails?C) ...
23 Oct 2012 by arielbeck
Hey, I'm facing the following problem:1. i have Exchange server (2007).2. i want to be able to do the following:for each mail that its subject starts with "s:", instead of sending it to the recipient, forward it to a specific internal IP addressi've tried transport rules, i can specify...
23 Oct 2012 by arielbeck
Managed to do it using TransportAgent - which redirects mails to a smart host (send connector) that should be defined.
6 Feb 2018 by Member 13336882
I am using this code to get the list of email folders : Class emailFolder Public Property Title As String End Class Public Shared Function GetFolders() As List(Of emailFolder) Dim folder = New List(Of emailFolder) Dim foldername =...
6 Feb 2018 by Jochen Arndt
You have an inner loop (foreach subfolder In subfolders) but create the name always from the parentFolder. So it should be (untested) ' Optionally add parent folder always here 'folder.Add(New emailFolder With {.Title = parentFolder.Name}) If parentFolder.HasChildren Then Dim subfolders =...
15 Dec 2012 by gaga blues
Hello guys. I'm currently having troubles with sending an email. Here's the code: MailMessage mail = new MailMessage(); SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com"); mail.From = new MailAddress("mygoogleaccount@gmail.com"); ...
15 Dec 2012 by StackQ
Quote:The Microsoft .NET framework provides two namespaces, System.Net and System.Net.Sockets for managed implementation of Internet protocols that applications can use to send or receive data over the Internet . SMTP protocol is using for sending email from C#. SMTP stands for Simple Mail...
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!
15 Dec 2012 by Bert Goens
Dear gaga bluesSMTP server settings are not the same for every server.(unforunatly..)However this info is public.You should just google SMTP settings gmail (or any other)I found this brief list of requirements for gmail:Gmail SMTP server address: smtp.gmail.comGmail SMTP...
15 Dec 2012 by Krunal Rohit
Go by this :var smtp = new System.Net.Mail.SmtpClient(); { smtp.Host = "smtp.gmail.com"; smtp.Port = 587; smtp.EnableSsl = true; smtp.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network; smtp.Credentials = new...