smtp.c
/* connect to SMTP server and returns the socket fd */
connect to SMTP server and returns the socket fd
connect to SMTP server and returns the socket fd
static SOCKET smtpConnect(char *smtp_server,int port)
{
    SOCKET
        sfd;
    if (g_use_protocol == MSOCK_USE_IPV4)
    {
        showVerbose("Forcing to use IPv4 address of SMTP server\n");
    }
    else if (g_use_protocol == MSOCK_USE_IPV6)
    {
        showVerbose("Forcing to use IPv6 address of SMTP server\n");
    }
    else
    {
        showVerbose("Will detect IPv4 or IPv6 automatically\n");
    }
    sfd=clientSocket(g_use_protocol, smtp_server,port, g_connect_timeout);
    if (sfd == INVALID_SOCKET)
    {
        errorMsg("Could not connect to SMTP server \"%s\" at port %d",
                smtp_server,port);
        return (INVALID_SOCKET);
    }
    msock_set_socket(sfd);
    return (sfd);
}
static SOCKET smtpConnect ( char * smtp_server , int port ) { SOCKET sfd ; if ( g_use_protocol == MSOCK_USE_IPV4 ) { showVerbose ( " \n " ) ; } else if ( g_use_protocol == MSOCK_USE_IPV6 ) { showVerbose ( " \n " ) ; } else { showVerbose ( " \n " ) ; } sfd = clientSocket ( g_use_protocol , smtp_server , port , g_connect_timeout ) ; if ( sfd == INVALID_SOCKET ) { errorMsg ( " \" \" " , smtp_server , port ) ; return ( INVALID_SOCKET ) ; } msock_set_socket ( sfd ) ; return ( sfd ) ; }
connect to SMTP server and returns the socket fd
connect to SMTP server and returns the socket fd
/* set the socket to msock lib's static place, not thread safe*/