CodeCharge Studio$DBIntranetDB = clsDBIntranetDB->new();
if (CCGetSession("UserID") != $tasks->{user_id_assign_to}->GetValue())
{
$from_name = CCDlookUp("emp_name", "employees", "emp_id=" .
$DBIntranetDB->ToSQL(CCGetSession("UserID"), $ccsInteger), $DBIntranetDB);
$from_email = CCDlookUp("email", "employees", "emp_id=" .
$DBIntranetDB->ToSQL(CCGetSession("UserID"), $ccsInteger), $DBIntranetDB);
$to_email= CCDlookUp("email", "employees", "emp_id=" .
$DBIntranetDB->ToSQL($tasks->{user_id_assign_to}->GetValue(), $ccsInteger), $DBIntranetDB);
$subject = "A task was assigned to you";
$message = "The following task was assigned to you:<br><br>" .
"Task ID: " .CCGetFromGet("task_id","") ."<br><br>" .
$tasks->{task_desc}->GetValue();
if (open(SENDMAIL, "| sendmail $from_name"))
{
print SENDMAIL "From: $from_email\nTo: $to_email\nSubject: $subject\n\n$message\n.\n";
close(SENDMAIL);
}
}
The main differences between the above code and that which was used in the After Insert event are as follows:
http://localhost/TaskManager/tasks_maint.cgi?task_id=9Next: Test Email Delivery