shadiadiph Posted June 5, 2010 Share Posted June 5, 2010 Hi i have just changed hosts and sendmail is active in php but doesn't work without smtp authentication they don't seem to have any PEAR packages just wondering if anyone knows how to define this in the mail(); function or if it is possible to define the $params for smtp host: port: username: password: ?? $send = mail($to, $subject, $body, $header, $params); Quote Link to comment https://forums.phpfreaks.com/topic/203986-how-to-send-smtp-values-in-mail/ Share on other sites More sharing options...
dabaR Posted June 5, 2010 Share Posted June 5, 2010 I suggest using SwiftMailer: http://swiftmailer.org/docs/sending-quickref Quote Link to comment https://forums.phpfreaks.com/topic/203986-how-to-send-smtp-values-in-mail/#findComment-1068385 Share on other sites More sharing options...
shadiadiph Posted June 5, 2010 Author Share Posted June 5, 2010 Thanks I have had a look at it but looks like it just sends plain text messages I have to find a work around this that can include html css and attachments from the first glance it might work I will give it a go I have so many email templates already set up and working is there really no way to send the smtp login through mail() if not is there another work around in php or does anyone know of a good smtp server reference guide where I can study what the server asks for when you call it as I am sure this could be done another way if need be with fsockopen and fputs and fgets for the server response. Quote Link to comment https://forums.phpfreaks.com/topic/203986-how-to-send-smtp-values-in-mail/#findComment-1068397 Share on other sites More sharing options...
dabaR Posted June 5, 2010 Share Posted June 5, 2010 I would just like to add that SwiftMailer is not hard to use, well-documented, robust enough to meet pretty much anyone's needs, and can of course send attachments. Quote Link to comment https://forums.phpfreaks.com/topic/203986-how-to-send-smtp-values-in-mail/#findComment-1068406 Share on other sites More sharing options...
shadiadiph Posted June 5, 2010 Author Share Posted June 5, 2010 Thank you I will have a look at it, but first I shall have a crack at writing a small function to try to talk to the smtp server should be interesting if mail() can't do it I am suprised there is no function smtpmail() after all it should be simple SMTP simple mail transfer protocol Quote Link to comment https://forums.phpfreaks.com/topic/203986-how-to-send-smtp-values-in-mail/#findComment-1068408 Share on other sites More sharing options...
newbtophp Posted June 5, 2010 Share Posted June 5, 2010 Thank you I will have a look at it, but first I shall have a crack at writing a small function to try to talk to the smtp server should be interesting if mail() can't do it I am suprised there is no function smtpmail() after all it should be simple SMTP simple mail transfer protocol php mailer? http://phpmailer.worxware.com/ Quote Link to comment https://forums.phpfreaks.com/topic/203986-how-to-send-smtp-values-in-mail/#findComment-1068409 Share on other sites More sharing options...
dabaR Posted June 5, 2010 Share Posted June 5, 2010 ...after all it should be simple SMTP simple mail transfer protocol... I always thought it stood for Send Mail To People Quote Link to comment https://forums.phpfreaks.com/topic/203986-how-to-send-smtp-values-in-mail/#findComment-1068411 Share on other sites More sharing options...
shadiadiph Posted June 6, 2010 Author Share Posted June 6, 2010 Anyway thanks for the advice dabaR and newbtophp but i wrote a script this morning to communicate with the smtp server and it works perfectly Quote Link to comment https://forums.phpfreaks.com/topic/203986-how-to-send-smtp-values-in-mail/#findComment-1068468 Share on other sites More sharing options...
dabaR Posted June 6, 2010 Share Posted June 6, 2010 Anyway thanks for the advice dabaR and newbtophp but i wrote a script this morning to communicate with the smtp server and it works perfectly Good job! Quote Link to comment https://forums.phpfreaks.com/topic/203986-how-to-send-smtp-values-in-mail/#findComment-1068475 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.