Page 1 of 1

Gmail as SMTP

Posted: Fri May 02, 2014 9:27 pm
by skhanpara
Can i use Gmail As SMTP?

I'm using Host as "smtp.gmailo.com";
port = 465;

but not result

I download CustomLogger from Ranorex website.

Re: Gmail as SMTP

Posted: Mon May 05, 2014 3:02 pm
by skhanpara
I'm using this code to send mail


try
{
SmtpClient smtpClient = new SmtpClient();
smtpClient.Host = "smtp.gmail.com";
smtpClient.Port = 465;
smtpClient.Credentials = new NetworkCredential("My Email", "Mypassword");
smtpClient.EnableSsl = true;
smtpClient.Send(mail);
}
catch (Exception ex)
{
Console.Write(ex);
}
}

Re: Gmail as SMTP

Posted: Wed May 07, 2014 3:24 pm
by Support Team
Hello skhanpara,

Unfortunately we are not able to analyze what is causing your issue due to the lack of information.
May I ask you to provide your implemented custom logger class as well as the initialization of the class (which is usually done in the Program.cs) either via uploading the files to our forum or via mail ([email protected]).

Thank you in advance.

Regards,
Robert

Re: Gmail as SMTP

Posted: Wed May 07, 2014 4:45 pm
by skhanpara
Thank for your reply

I am uploading a sample file i was trying to mail

Re: Gmail as SMTP

Posted: Mon May 12, 2014 10:04 am
by Support Team
Hello skhanpara,

You need to use port 25 for your SMTP client.

Please find attached a solution with specified SMTP client for gmail.

Just modify:

Code: Select all

System.Net.NetworkCredential basicCredential = new System.Net.NetworkCredential ("YourEmail", "YourPassword");
within the MailLogger.cs

Code: Select all

MailLogger mailLogger = new MailLogger("From", "To",
                                                   "Ranorex Report for CustomLogging");
within the Program.cs

Regards,
Robert

Re: Gmail as SMTP

Posted: Mon May 12, 2014 7:41 pm
by skhanpara
Thank you so much

Re: Gmail as SMTP

Posted: Tue May 13, 2014 3:36 pm
by skhanpara
still i am not able to send
i made all the changes you told me

please advise

Re: Gmail as SMTP

Posted: Wed May 14, 2014 9:24 am
by swmatisa
Hello,
If you have a proxy, I think you must change your code. Google will help you :D

Hope this help