title: error C3861: '_T': identifier not found , unable to pass in main function parameters as function parameters
body: <p>I am following this <a href="http://www.emailarchitect.net/easendmail/kb/vc.aspx?cat=2" rel="noreferrer">guide</a> on using C++ to send emails. I followed the instructions and it works perfectly fine</p>
  
  <p>This is the sample code on how to send emails using the program , I have changed the email address and password for security purposes</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;iostream&gt;
  #include "easendmailobj.tlh"
  using namespace EASendMailObjLib;
  using namespace std;
  
  int _tmain(int argc, _TCHAR* argv[])
  {
      ::CoInitialize( NULL );
  
      IMailPtr oSmtp = NULL;
      oSmtp.CreateInstance( "EASendMailObj.Mail");
      oSmtp-&gt;LicenseCode = _T("TryIt");
  
      // Set your gmail email address
      oSmtp-&gt;FromAddr = _T("randomemail1.lim@gmail.com");
  
      // Add recipient email address
      oSmtp-&gt;AddRecipientEx( _T("randomemail2s@hotmail.com"), 0 );
  
      // Set email subject
      oSmtp-&gt;Subject = _T("simple email from Visual C++ with gmail account");
  
      // Set email body
      oSmtp-&gt;BodyText = _T("this is a test email sent from Visual C++ project with Gmail");
  
      // Gmail SMTP server address
      oSmtp-&gt;ServerAddr = _T("smtp.gmail.com");
  
      // If you want to use direct SSL 465 port, 
      // Please add this line, otherwise TLS will be used.
      // oSmtp-&gt;ServerPort = 465;
  
      // detect SSL/TLS automatically
      oSmtp-&gt;SSL_init();
  
      // Gmail user authentication should use your 
      // Gmail email address as the user name. 
      // For example: your email is "gmailid@gmail.com", then the user should be "gmailid@gmail.com"
      oSmtp-&gt;UserName = _T("somerandomemail@gmail.com");
      oSmtp-&gt;Password = _T("somepassword");
  
      _tprintf(_T("Start to send email via gmail account ...\r\n" ));
  
      if( oSmtp-&gt;SendMail() == 0 )
      {
          _tprintf( _T("email was sent successfully!\r\n"));
      }
      else
      {
          _tprintf( _T("failed to send email with the following error: %s\r\n"),
              (const TCHAR*)oSmtp-&gt;GetLastErrDescription());
      }
  
      if( oSmtp != NULL )
          oSmtp.Release();
  
      int x;
      cin&gt;&gt;x;
  
      return 0;
  }
  </code></pre>
  
  <p>When i attempt to copy paste this code into my program and make it as a function which i can use , I get the following error</p>
  
  <pre><code>error C3861: '_T': identifier not found 
  </code></pre>
  
  <p>This is what my functions looks like </p>
  
  <pre><code>void DriverClass::send_email(int argc, _TCHAR* argv[])
  {
      ::CoInitialize( NULL );
  
      IMailPtr oSmtp = NULL;
      oSmtp.CreateInstance( "EASendMailObj.Mail");
      oSmtp-&gt;LicenseCode = _T("TryIt");
  
      // Set your gmail email address
      oSmtp-&gt;FromAddr = _T("randomemail1.com");
  
      // Add recipient email address
      oSmtp-&gt;AddRecipientEx( _T("randomemail2@hotmail.com"), 0 );
  
      // Set email subject
      oSmtp-&gt;Subject = _T("simple email from Visual C++ with gmail account");
  
      // Set email body
      oSmtp-&gt;BodyText = _T("this is a test email sent from Visual C++ project with Gmail");
  
      // Gmail SMTP server address
      oSmtp-&gt;ServerAddr = _T("smtp.gmail.com");
  
      // If you want to use direct SSL 465 port, 
      // Please add this line, otherwise TLS will be used.
      // oSmtp-&gt;ServerPort = 465;
  
      // detect SSL/TLS automatically
      oSmtp-&gt;SSL_init();
  
      // Gmail user authentication should use your 
      // Gmail email address as the user name. 
      // For example: your email is "gmailid@gmail.com", then the user should be "gmailid@gmail.com"
      oSmtp-&gt;UserName = _T("randomemail1@gmail.com");
      oSmtp-&gt;Password = _T("randompassword");
  
      _tprintf(_T("Start to send email via gmail account ...\r\n" ));
  
      if( oSmtp-&gt;SendMail() == 0 )
      {
          _tprintf( _T("email was sent successfully!\r\n"));
      }
      else
      {
          _tprintf( _T("failed to send email with the following error: %s\r\n"),
              (const TCHAR*)oSmtp-&gt;GetLastErrDescription());
      }
  
      if( oSmtp != NULL )
          oSmtp.Release();
  
      int x;
      cin&gt;&gt;x;
  
  
  }
  </code></pre>
  
  <p>I think it has something to do with the fact that i cant pass in <code>int argc</code> and <code>_TCHAR*argc[]</code> as arguements , How do make it into a function which i can use and how do i solve it ???</p>