What do I write for 'smtpserver'?

Discussion in 'Programming' started by cre8ive, May 11, 2008.

  1. #1
    I have the following configuration file.

    <?php
    	define("HOST", "localhost");
    	define("PORT", 3306);
    	define("USER", "xxx123");
    	define("PASS", "xyz456");
    	define("DB", "jobs");
    	define("smptserver",'smtpserver');
    	define("supportemail",'emailadress');
    	define("bcc",'emailaddress');
    ?>
    Code (markup):
    (This is from Job Recruitment system by the way.)

    What do I write for 'smtpserver'? Yeah, I know, this is an amateur question, but I'm totally confused ...
     
    cre8ive, May 11, 2008 IP
  2. eddy2099

    eddy2099 Peon

    Messages:
    8,028
    Likes Received:
    568
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The (Simple Mail Transport Protocol) SMTP Server is the mail server which is used to send out the email. If you are hosting this on your website, it would most probably be 'mail.yoursite.com' or 'smtp.yoursite.com'.
     
    eddy2099, May 11, 2008 IP
  3. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #3
    
    <?php
    
    // path to 'MAIL.php' file from XPM4 package
    require_once '/path-to/MAIL.php';
    
    $m = new MAIL; // initialize MAIL class
    $m->From('username@gmail.com'); // set From mail address
    $m->AddTo('client@destination.net'); // add To mail address
    $m->Subject('Hello World!'); // set your mail subject
    // set your mail message (text/html)
    $m->Html('<b>HTML</b> <u>message</u>.');
    
    // connect to MTA server 'smtp.gmail.com' port '465' via SSL ('tls' encryption)
    // with authentication: 'username@gmail.com' and 'password'
    // set the connection timeout to 10 seconds, the name of your
    // host 'localhost' and the authentication method to 'plain'
    // make sure you have OpenSSL module (extension) enable on your php configuration
    $c = $m->Connect('smtp.gmail.com', 465, 'username@gmail.com', 'password',
    'tls', 10, 'localhost', null, 'plain') or die(print_r($m->Result));
    
    // send mail relay using the '$c' resource connection
    echo $m->Send($c) ? 'Mail sent !' : 'Error !';
    
    // disconnect from server
    $m->Disconnect();
    
    ?>
    
    PHP:
     
    Barti1987, May 12, 2008 IP