Link to home
Start Free TrialLog in
Avatar of Md Shah
Md ShahFlag for India

asked on

Issue with SmtpClient in sending GMAIL Message

Hello Experts,

I am trying to send Message from my GMAIL account via C# code.

I could able to send it via classic methos i.e. by using 'System.Web.Mail.SmtpMail.Send(Mail)'. Find the attachement - "Working-Copy.JPG".

But I couldn't able to send GMAIL message from C# code by using System.Net.Mail.SmtpClient'.

I tried with two ways:

1) By Routine Procedure. Find the attachment - "TriedWithThisToo.JPG".

2) By using OpenPOP3 API. Find the attachment - "OpenPop3.JPG".

I want to send GMAIL message by using SmtpClient only for my project.

Any help would be grateful.

Cheers
Working-Copy.JPG
TriedWithThisToo.JPG
OpenPop3.JPG
ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Md Shah

ASKER

Thanks David your code has worked too.

But the main issue why i am opting to go for OpenPop3 API is...

In my project, I need to read new messages from client and need to REPLY to client message with ATTACHMENT.

Please let me know if I can achieve REPLY TO and ATTACHMENT with your above code
Avatar of Md Shah

ASKER

Thanks