Dysan Posted March 13, 2008 Share Posted March 13, 2008 What's the best secure way to send an hard-coded email using PHP? Also, how do you include the SMTP server details in the script? Can anybody give me an example to play around with? Link to comment https://forums.phpfreaks.com/topic/95905-send-email/ Share on other sites More sharing options...
msimonds Posted March 13, 2008 Share Posted March 13, 2008 Try this class > http://www.gerd-tentler.de/tools/mimemail/main.php I use it in all my applications and it works great. It has an example in the download: include('mimemail.inc.php'); $mail = new MIMEMAIL("HTML"); $mail->senderName = "sender name"; $mail->senderMail = "sender@email"; $mail->bcc = "bcc@email"; $mail->subject = "This is the subject line"; $mail->body = "Hello! This is a message for you."; // OR: $mail->body = "path/to/file"; $mail->attachments[] = "path/to/file1"; $mail->attachments[] = "path/to/file2"; ... $mail->create(); $recipients ='recipient1@email,recipient2@email,recipient3@email'; if(!$mail->send($recipients)) echo $mail->error; Link to comment https://forums.phpfreaks.com/topic/95905-send-email/#findComment-491190 Share on other sites More sharing options...
l0ve2hat3 Posted March 13, 2008 Share Posted March 13, 2008 much easy this way <?php $to = '[email protected]'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]'; mail($to, $subject, $message, $headers); ?> Link to comment https://forums.phpfreaks.com/topic/95905-send-email/#findComment-491351 Share on other sites More sharing options...
Dysan Posted March 14, 2008 Author Share Posted March 14, 2008 much easy this way <?php $to = '[email protected]'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]'; mail($to, $subject, $message, $headers); ?> How do I include the SMTP server details within the script Link to comment https://forums.phpfreaks.com/topic/95905-send-email/#findComment-492183 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.