Logo Search packages:      
Sourcecode: nbsmtp version File versions  Download package

int nbsmtp_ehlo ( servinfo_t serverinfo  ) 

Sends EHLO SMTP command.

Parameters:
[in] serverinfo Pointer to a servinfo_t struct with the server information
Returns:
1 in command success, 0 in case of error

Definition at line 306 of file nbsmtp.c.

References servinfo::domain, log_msg(), smtp_okay(), and smtp_write().

Referenced by send_mail().

{
      char *local_out_buf;

      asprintf(&local_out_buf,"EHLO %s",serverinfo->domain);

      if (smtp_write(serverinfo,local_out_buf)<1)
      {
            log_msg(LOG_ERR,"Error writing EHLO command to the socket");
            free(local_out_buf);
            return 0;
      }

      free(local_out_buf);

      if(!smtp_okay(serverinfo))
      {
            log_msg(LOG_ERR,"EHLO command failed");
            return 0;
      }

      return 1;
}


Generated by  Doxygen 1.6.0   Back to index