Jump to content

Sending and Reciving email with php...confused


strujillo

Recommended Posts

Ok so i created a social networking program for my school. Its coded in php and using the MySQL database. In this teachers and students can communicate through an internal emailing system (Kind of like what myspace and facebook do)...well my teachers said it would be alot better if they could just get the emails sent straight to them and not have check the social network all the time. So do you know how i would do this? Also how would they reply? i mean, how would the user get the message. thats where im stuck.

 

1. Send mail from students to teachers email (mail(); i think)

2. HOW do i receive mail and distribute it to the correct students

 

Anything on this subject would be helpful.

The from and reply to settings are set in the header parameter of the mail function.

The following example is from php.net

<?php
$to      = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
    'Reply-To: webmaster@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>

 

The full function details are here http://us2.php.net/manual/en/function.mail.php

 

Hope this helps :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.