nand Posted September 22, 2005 Share Posted September 22, 2005 this issue is not about core php hacking, but I guess this topic fits here best. I want to make php mail() function send emails using remote smtp server. I want to force this to all mail() users at my servers. However I use linux php so I cant specify remote smtp in php.ini cause php passes emails directly to sendmail/qmail ... (ps. I dont need script to use with remote smtp by socket connections, i want to make MAIL() do it so my users dont have to change anything at their source). So what I need is a) MTA like sendmail that actualy dont send mails to repicients, but it transfers it to remote mta-smtp (ps. I dont want relay, cause I dont want relaing to be visible in source of message) or b) some core hack-mod to make php mail() with php.ini work like on windows - not with sendmail/qmail but with socket connection to smtp. Any ideas.. I guess not Quote Link to comment Share on other sites More sharing options...
micha8l Posted January 2, 2011 Share Posted January 2, 2011 Hey,Read your little question. What you want to do is in download the Zend_Mail class. And the make a script like this:[code=php:0]<?phprequire_once('Zend/Mail.php'); $config = array( 'auth' => 'login', 'username' => 'you@gmail.com', 'password' => 'gmailPassword', 'port' => 465 ); $transport = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $config); $mail = new Zend_Mail(); $mail->setBodyText( "email message" ); $mail->setFrom( recipientEmail, recipientName); $mail->addTo( $email ); $mail->setSubject('form submission'); $mail->send( $transport );[/code]have fun Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.