title: Sending an image in base64 via Telnet
body: <p>I am currently working on a project for school and have ran into an issue with a large amount of data being sent via Telnet. If I send a message less than 10KB it is fine. However if I send a message that is above 10KB, I receive the following error "501 Syntax error - line too long" after a few minutes of it running.</p>
  
  <p>Does anyone know of a better way to implement what I am trying to accomplish, that will preferably work with the send()? The data being sent is 5 pages (in Word) of an image in base64. </p>
  
  <p>Thank you, any help is greatly appreciated.</p>
  
  <p>Here is the code portions that I am currently using, which work, with small amounts of data.</p>
  
  <pre><code>char *MailContents = new char[20000000];
  
  std::ifstream in("C:\\test.txt");
  std::string MailData((std::istreambuf_iterator&lt;char(in)),std::istreambuf_iterator&lt;char&gt;()); 
  //The following streams in the data into MailData() from a .txt file.
  
  
  memcpy(MailContents, MailData.c_str(), MailData.length()); //This takes the data and copies it to MailContents
  strcat(MailContents, "\r\n");
  
  send(Connection, MailContents, strlen(MailContents), 0); //The following line will take the data in MailContents and echo it to the Telnet data section to be sent.
  
  send(Connection, ".\r\n", strlen(".\r\n"), 0); //This line terminates the data entry and sends it.
  </code></pre>