Hi I am newbie to php and am trying to do a site for my alumni
i downloaded a alumni script but am not getting a mail when a user registers. The code is as below:
$subject1="New Alumni registration";
$message1="A new member has registered on the alumni website \n\n First Name: $fname\n\n Surname: $sname\n\n Present Surname: $nsname\n\n Year left: $leave\n\n e-mail address: $mail\n\n Postal Address:\n$add";
mail($Mail, $subject1, $message1,"From: $mail");
I contacted my webspace provider and he has suggested to put as:
<?php
require_once "Mail.php";
$from = "name Sender <mail@domain.com>";
$to = "name Recipient <mail@domain.com>";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$host = "mail.domain.com";
$username = "smtp_username";
$password = "smtp_password";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $body);
}
?>
How do i merge both the codes? Can someone please help. I tried doing but it is not working.