public function comment_mail_notification() { $mail = new PHPMailer(); $mail->isSMTP(); $mail->Host = SMTP_HOST; $mail->SMTPAuth = SMTP_AUTH; $mail->Username = SMTP_USER; $mail->Password = SMTP_PASS; $mail->SMTPSecure = SMTP_SECURE; $mail->Port = SMTP_PORT; $mail->From = SMTP_FROM; $mail->FromName = SMTP_FROM_NAME; $mail->addReplyTo(SMTP_REPLY_TO, SMTP_REPLY_TO_NAME); $mail->addAddress(SMTP_TO, SMTP_TO_NAME); $mail->isHTML(SMTP_ISHTML); $mail->Subject = SMTP_SUBJECT . strftime("%T", time()); $created = datetime_to_text($this->created); $mail_body = nl2br($this->body); $photo = Photograph::find_by_id($_GET['id']); $mail->Body = <<<EMAILBODY A new comment has been received in the Photo Gallery.<br> <br> Photograph: {$photo->filename}<br> <br> On {$created}, {$this->author} wrote:<br> <br> {$mail_body}<br> EMAILBODY; $result = $mail->send(); return $result; }
public function try_to_send_notification() { $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = "your.host.com"; $mail->Port = 25; $mail->SMTPAuth = false; $mail->Username = "******"; $mail->Password = "******"; $mail->FromName = "Photo Gallery"; $mail->From = ""; $mail->AddAddress("", "Photo Gallery Admin"); $mail->Subject = "New Photo Gallery Comment"; $created = datetime_to_text($this->created); $mail->Body = <<<EMAILBODY A new comment has been received in the Photo Gallery. At {$created}, {$this->author} wrote: {$this->body} EMAILBODY; $result = $mail->Send(); return $result; }
public function try_to_send_notification() { $mail = new PHPMailer(); $mail->SMTPDebug = 0; // enables SMTP debug information (for testing) // 1 = errors and messages // 2 = messages only $mail->IsSMTP(); // Set mailer to use SMTP $mail->Host = 'smtp.mail.yahoo.com'; // Specify main and backup server $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = '******'; // SMTP username $mail->Password = '******'; // SMTP password $mail->Port = 465; $mail->SMTPSecure = 'ssl'; // Enable encryption, 'ssl' also accepted: original was 'tls' $mail->From = '*****@*****.**'; $mail->FromName = 'Photo Gallery Admin'; $mail->AddAddress('*****@*****.**'); // Name is optionals $mail->WordWrap = 70; // Set word wrap to 50 characters $mail->IsHTML(true); // Set email format to HTML $mail->Subject = 'New Photo Gallery Comment'; $created = datetime_to_text($this->created); // below is a use of a 'here document' $mail->Body = <<<EMAILBODY A new comment has been received in the Photo Gallery On {$created}. <br /> The author, {$this->author}, wrote: <br /><br /> {$this->body} EMAILBODY; return $mail->send(); // if(!$mail->Send()) { // echo 'Message could not be sent.'; // echo 'Mailer Error: ' . $mail->ErrorInfo; // exit; // } else { // echo "Message sent."; // } }
public function try_to_send_notification() { try { $message = new Message(); //$message->setSender("*****@*****.**"); $message->addTo("*****@*****.**"); $message->setSubject("New Photo Gallery Comment"); $created = datetime_to_text($this->created); $message->setTextBody("\nA new comment has been received in the Photo Gallery.\n\n At {$created}, {$this->author} wrote:\n\n{$this->body}"); //$message->addAttachment('image.jpg', $image_data, $image_content_id); $message->send(); } catch (InvalidArgumentException $e) { echo "erro in sending email"; } }
?> <div class="comment" style="margin-bottom: 2em;"> <div class="author"> <?php echo htmlentities($comment->author); ?> wrote: </div> <div class="body"> <?php echo strip_tags($comment->body, '<strong><em><p>'); ?> </div> <div class="meta-info" style="font-size: 0.8em;"> <?php echo datetime_to_text($comment->created); ?> </div> </div> <?php } ?> <?php if (empty($comments)) { echo "No Comments."; } ?> </div> <div id="comment-form">
<th>Comments</th> <th>View</th> <?php if ($_SESSION['role'] != "moderator" && $_SESSION['role'] != "student") { echo "<th>Edit</th>\n\t\t\t\t\t<th>Delete</th>"; } ?> </tr> </thead> <?php foreach ($requests as $request) { ?> <tr> <td><?php echo datetime_to_text($request->created); ?> </td> <td><?php echo ucfirst($request->department); ?> </td> <td><?php echo $request->subject; ?> </td> <td><?php echo $request->priority; ?> </td> <td><?php
?> </td> <td><?php echo $assignment->teacher; ?> </td> <td><?php echo $assignment->batch; ?> </td> <td><?php echo datetime_to_text($assignment->deadline); ?> </td> <td><?php echo datetime_to_text($assignment->created); ?> </td> <td> <a href="view_assignment.php?id=<?php echo $assignment->id; ?> "><i class="small circular inverted yellow eye icon"></i></a> </td> <?php if ($_SESSION['role'] != "cr" && $_SESSION['role'] != "student") { echo "<td><a href=\"edit_assignment.php?id={$assignment->id}\"><i class=\"small circular inverted orange edit icon\"></i></a></td>\t\n\t\t\t<td><a href=\"delete_assignment.php?id={$assignment->id}\" onclick=\"return confirm('Are you sure?');\"><i class=\"small circular inverted red remove icon\"></i></a></td>\n\t\t\t\n\t\t\t"; } ?> </tr> <?php
foreach ($maoni as $oni) { ?> <div class="author"> Maoni ya <?php echo htmlentities($oni->author); ?> : </div> <div class="body"> <?php echo strip_tags($oni->body, '<strong><em><p>'); ?> </div> <div class="meta-info" style="font-size: 0.8em;"> <?php echo datetime_to_text($oni->created); ?> </div> </div> <?php } ?> <h6><?php if (empty($maoni)) { echo "Bado Hamna Maoni"; } ?> </h6> </div> <!--End pic and news--> <?php
?> </td> <td><?php $creater = $user->created_by; if ($creater == 0) { echo "System"; } else { $user_creater = User::find_by_id($creater); echo $user_creater->first_name; } ?> </td> <td><?php echo datetime_to_text($user->created); ?> </td> <td><a href="edit_users.php?id=<?php echo $user->id; ?> "><i class="small circular inverted orange edit icon"></i></a></td> <td><a href="delete_users.php?id=<?php echo $user->id; ?> " onclick="return confirm('Are you sure?');"><i class="small circular inverted red remove icon"></i></a></td> </tr> <?php } ?> </table>
</div> <div class="field"> <label>Batch</label> <p><?php echo $assignment->batch; ?> </p> </div> <?php $deadline = $assignment->deadline; if ($deadline != "0000-00-00 00:00:00") { echo "\n\t\t<div class=\"field\">\n\t\t\t<label>Deadline</label>\n\t\t\t<p>"; echo datetime_to_text($assignment->deadline); echo "</p>\n\t\t</div>"; } else { echo "\n\t\t<div class=\"field\">\n\t\t\t<label>Deadline</label>\n\t\t\t<p>Post a deadline</p>\n\t\t</div>\n\t\t"; } ?> </div> </div> <!-- segment --> <script type="text/javascript" src="public/datetime/bootstrap-datetimepicker.min.js" charset="UTF-8"></script>
public function get_message_nav($chat) { global $path_admin; $chat->set_up_display(); $from_user = User::find_by_id($chat->user_id); $when = DateDifferenceFormat($chat->input_date, unixToMySQL(time())); $output = ""; $output .= "<div class=\"dropdown-messages-box\">"; $output .= "<a href=\" {$path_admin} profile.php\" class=\"pull-left\">"; $output .= " <img alt=\"image\" class=\"img-circle\" src=\""; $output .= $from_user->user_path_and_placeholder(); $output .= "\" >"; $output .= "</a>"; $output .= "<div class=\"media-body\">"; $output .= " <small class=\"pull-right\">"; $output .= $when; $output .= "</small><strong><span style=\"color: blue\">"; $output .= $from_user->full_name(); $output .= "</span></strong> wrote:<br> <strong>"; $output .= $chat->message; $output .= "</strong>. <br>\n <small class=\"text-muted\">"; $output .= datetime_to_text($chat->input_date); $output .= "</small>\n </div>\n </div>\n </li>\n <li class=\"divider\"></li>"; $output .= ""; $output .= ""; $output .= ""; $output .= ""; return $output; }
public function comment_mail_notification() { // This method uses PHPMailer // See sendmail.php for using PHP's standard built in mail() function $mail = new PHPMailer(); // phpMailer reporting $mail->SMTPDebug = 3; // You can leave out the following section and PHPMailer will still function as a // class and mehtod, as detailed below, but will use the standard PHP Sendmail function. // In order to utilise the SMTP features of PHPMailer, set isSMTP() and your server details. // SMTP sending server configs $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = SMTP_HOST; // Specify main and backup SMTP servers $mail->SMTPAuth = SMTP_AUTH; // Enable SMTP authentication $mail->Username = SMTP_USER; // SMTP username $mail->Password = SMTP_PASS; // SMTP password $mail->SMTPSecure = SMTP_SECURE; // Enable TLS encryption, `ssl` also accepted $mail->Port = SMTP_PORT; // TCP port to connect to // End of SMTP Configs // FROM: details $mail->From = SMTP_FROM; $mail->FromName = SMTP_FROMNAME; // Reply-To (if different) $mail->addReplyTo('*****@*****.**', 'User Name'); // $to_name = "User Name"; // $to = "*****@*****.**"; // TO: details // $mail->addAddress($to, $to_name) $mail->addAddress('*****@*****.**', 'User Name'); // Add a recipient // $mail->addAddress('*****@*****.**'); // Name is optional // $mail->addCC('*****@*****.**'); // $mail->addBCC('*****@*****.**'); // Attachments // $mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments // $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name // Mail format $mail->isHTML(SMTP_ISHTML); // Set email format to HTML // Mail Subject $mail->Subject = SMTP_SUBJECT . strftime("%T", time()); // Mail Body // $mail->Body = 'A new comment has been received.'; // $mail->AltBody = 'A new comment has been received.'; // Format the created time more nicely. $created = datetime_to_text($this->created); // Ensure line endings are preserved even in HEREDOC HTML email output. $mail_body = nl2br($this->body); // Get all the photo attributes so we can use them in the email $photo = Photograph::find_by_id($_GET['id']); // Generate the email body with HEREDOC $mail->Body = <<<EMAILBODY A new comment has been received in the Photo Gallery.<br> <br> Photograph: {$photo->filename}<br> <br> On {$created}, {$this->author} wrote:<br> <br> {$mail_body}<br> EMAILBODY; // Process mail and Status feedback // if(!$mail->send()) { // echo 'Message could not be sent.'; // echo 'Mailer Error: ' . $mail->ErrorInfo; // } else { // echo '<br><br><hr>'; // echo 'Message has been sent'; // } // Alternate process with no feedback $result = $mail->send(); return $result; }