How to send mail csharp – C#

Tuesday, July 25th, 2017 (0 Comment)

In java section, we have Sending gmail or mail in java article, and now we will convert this article to send mail csharp (C#).

We will use host mail is your localhost and gmail to send or receive mail.

We need to using System.Net.Mail library for send mail csharp

1) Send mail CSharp using your localhost (your host company, not gmail)

Use username and password to Credential

We also not use username and password to Credential, we use local network but this way only send mail in local, not send to gmail.

2) Send mail CSharp using gmail host

We also use code in section 1 and modify some information

We need to check local connect to smtp.gmail.com via 587 port. type in command: telnet smtp.gmail.com 587 or telnet smtp.gmail.com 465

 

Tags: , , ,

Related Posts

csharp
Connection to ldap in csharp – C# simple
csharp
How to call lua in CSharp – C#
csharp
Convert object to json in CSharp – C# and vice versa
csharp
Encode and decode in CSharp – C#

Related Posts

csharp
Connection to ldap in csharp – C# simple
csharp
How to call lua in CSharp – C#
csharp
Convert object to json in CSharp – C# and vice versa
csharp
Encode and decode in CSharp – C#

Leave a Reply

Your email address will not be published. Required fields are marked *