Member Avatar for TheFearful

Hey everyone, I have been trying to send a test email before I do any further development and can't see to figure out why I am getting this error
Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()

This is the code I I decided to use to test

$to = "wlopez@corp.ptd.net";
    $subject = "Hello!";
    $txt = "Hello world";
    $headers = "From: webmaster@example.com" . "\r\n" .
    "CC: somebodyelse@example.com";

    mail($to, $subject, $txt, $headers);

I changed the php.ini file to the actual SMTP server of the company but still can't seem to figure out what is going wrong on my part. Any help would be great!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.