Sending email using PHP

Any script creating excessive mail error messages is likely to be disabled.

WARNING: Any inappropriate use of University email facilities will result in your account being disabled.

On the stuiis.cms.gre.ac.uk server

To send an email through PHP on stuiis.cms.gre.ac.uk you need to add the following line to your code before using the mail() function:

ini_set("sendmail_from","username@gre.ac.uk");

Replace username with your user ID (e.g. cl697)

You can then use the mail() function to send your email:

mail("anotheruser@gre.ac.uk", "email title", "email message");

Alternatively you can specify the ‘From’ address in the mail() command:

mail( $t_email, $subject, $message, "From: username@gre.ac.uk\r\n");

Replace username with your user ID (e.g. cl697)

On the stuweb.cms.gre.ac.uk server

To send an email through PHP on stuweb.cms.gre.ac.uk you need to use the following command:

mail("[TO_ADDRESS]", "[SUBJECT]", "[MESSAGE]", "From: [USERID]@gre.ac.uk\r\n");

To send an email through PHP on stuweb.cms.gre.ac.uk you need to use the following command:

  • Replace [TO_ADDRESS] with the email address that you wish to send the email to
  • Replace [SUBJECT] with the email’s subject (summarising the contents of the email)
  • Replace [MESSAGE] with the main content that you wish to send (i.e. your message)
  • Replace [USERID] with your user ID (e.g. cl697)

Comments are closed.