Hello everyone. I made this little program for sending mail, everything looks fine (for me), got no errors, debugging without a problem. Only problem is that its not working. My program doesn't send mail. Can you please tell me why? Thanks.

Code:

// msdnproba2.cpp : main project file.

#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>

using namespace System;
using namespace System::Net::Mail;
using namespace System::Net;
using namespace std;

int main(array<System::String ^> ^args)
{

  
  cout << "Sending mail..."<< endl;

  char f;
  cin >> f;
   
   
    return 0;
}

 static void Mail_test1( String^ server, int port )
 {
	 String^ to = L"[email protected]";
      String^ from = L"[email protected]";
      String^ subject = L"This is subject!";
      String^ body = L"Hello! This is a test.";
      MailMessage^ message = gcnew MailMessage( from,to,subject,body );
      SmtpClient^ client = gcnew SmtpClient( "smtp.mail.yahoo.com , 465" );

      
      client->Credentials = gcnew NetworkCredential("[email protected]", "mypassword", "smtp.mail.yahoo.com");
	  client->UseDefaultCredentials = false;
      
      ServicePoint^ p = client->ServicePoint;
      Console::WriteLine( L"Connection lease timeout: {0}", p->ConnectionLeaseTimeout );
      client->Send( message );
	  client->~SmtpClient();

	 
 }