SMTP Question

Hi, I just grab the following code from previous thread in the forum, everything has been set correctly, i reckon. The page return with "Success", but i haven't received any mail in my inbox. Was that Normal, or i should replace "localhost" by the ISP's mail.domain.com so that i could get a mail, or it's also working by other localhost configuration? Thanks

<?php

ini_set("SMTP","localhost");
ini_set("sendmail_from","[email protected]");

if (mail("[email protected]","This is a test","This is the body","From: [email protected]\r\nContent-type: text/plain\r\n\r\n"))
{
print "Success";
}
else
{
print "Failed";
}

?>
 
Martin, I always use the SMTP server address in scripts like yours rather than just Localhost.
 
BluJag said:
Martin, I always use the SMTP server address in scripts like yours rather than just Localhost.

sorry abt the rookie questions...what's the smtp server address for my local computer?
smtp.myusername.com or sth like that?
 
Your local computer!? Surely you are running this on a server, in which case it will something like mail.mydomain.com
 
BluJag said:
Your local computer!? Surely you are running this on a server, in which case it will something like mail.mydomain.com


BluJag, So if my computer name is martin, which will be mail.martin.com ? i'm installing apache, how do i know mydomin name? Thanks a lot
 
Sorry Martin - you are way out of your depth here. Suggest you do a lot of reading and or attend 3 yr college course.
 
Back
Top