Page 1 of 1

Please Help me to send Mails

Posted: Wed Jun 16, 2010 7:33 pm
by minos_mks
I need to know what i need to use the mail function successfully cause i got this massage and , thank you for your time

Re: Please Help me to send Mails

Posted: Wed Jun 16, 2010 8:26 pm
by PHPHorizons
Hello minos_mks,

You will need a mail server. Pegasus Mail/Mercury Mail comes to mind: http://www.pmail.com/
One problem you may have though is mail() does not allow authentication. And if you are planning on using Yahoo to send those mails out, I've had difficulty getting that to work.

You could purchase an SMTP Relay Service. Here's a google search on that: http://www.google.com/search?num=30&hl= ... y&gs_rfai=

Cheers

Re: Please Help me to send Mails

Posted: Wed Jun 16, 2010 10:54 pm
by Phoenixheart
As the error box shows, you need to populate proper SMTP settings in php.ini (either direct modification or using ini_set()).
As far as I remember you can try Gmail's SMTP.

Re: Please Help me to send Mails

Posted: Thu Jun 17, 2010 8:59 pm
by minos_mks
thanx every body for your time but , i have already the smtp ( hotmail ) smtp.live.com but i don't know what i should do with it , if there is any chance if somebody have like a video or any lesson explain this issue step by step because i am confused , thanx a lot

Re: Please Help me to send Mails

Posted: Fri Jun 18, 2010 6:14 am
by internet-solution
Get SMTP srever settings (server name, port, user name, password) from hotmail and then use fsocopen() function. see an example here on my site

Re: Please Help me to send Mails

Posted: Fri Jun 18, 2010 9:50 pm
by minos_mks
thanx man for your time

but i did the same and just change my information like this :

Code: Select all

     $smtp_server = "smtp.mail.yahoo.com";
$mydomain = "any_text_here";


//get the following info from your mail server eg. au.yahoo.com

$port = 25; //SMTP PORT of mail.mymailserver.com
$username = "mina_mks2003@yahoo.com"; $password = "*********";


$sender = "mina_mks2003@yahoo.com";

/*
Most respectable mail servers will reject outgoing mail
if $sender e-mail address does not belong to $username
*/

$sender_name = "Mina"; //Any name you fancy


$recipient = "minos_saad@hotmail.com";
$subject = "the subject";
$content = "the message";

// SMTP connection

$handle = fsockopen($smtp_server,$port);
fputs($handle, "EHLO $mydomain\r\n");

// SMTP authorization
fputs($handle, "AUTH LOGIN\r\n");
fputs($handle, base64_encode($username)."\r\n");
fputs($handle, base64_encode($password)."\r\n");

// Send out the e-mail
fputs($handle, "MAIL FROM:$sender\r\n");
fputs($handle, "RCPT TO:$recipient\r\n");
fputs($handle, "DATA\r\n");
fputs($handle, "From: $sender_name<$sender>\r\n");

//you can use different e-maill address in above line, but most spam blockers will suspect this

fputs($handle, "To: $recipient\r\n");
fputs($handle, "Subject: $subject\r\n");
fputs($handle, "$content\r\n");
fputs($handle, ".\r\n");

//Don't ignore the period "." in line above. This indicates the end of your mail

// Close connection to SMTP server
fputs($handle, "QUIT\r\n");

and it gives me an error it said :

Warning: fsockopen() [function.fsockopen]: unable to connect to smtp.mail.yahoo.com:25 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ) in C:\wamp\www\Coptic_List\includes\admin_functions.php on line 112

Fatal error: Maximum execution time of 60 seconds exceeded in C:\wamp\www\Coptic_List\includes\admin_functions.php on line 112

Re: Please Help me to send Mails

Posted: Mon Jun 21, 2010 8:05 am
by internet-solution
Are you sure you are using the correct sptm server information? In you previous post you mentioned hotmail (smtp.live.com), why are you using yahoo in the script?

Do you have a Yahoo premium account? Yahoo pop / smtp connection is only available to premuim accounts.

Re: Please Help me to send Mails

Posted: Mon Jun 21, 2010 10:45 am
by minos_mks
i was just trying to use a different smtp server , but i didn't know that it's not free , i don't know now if the problem now only the smtp or maybe another problems , and what about if i need to change the smtp server inside the php.ini , thanx for your help