ellescuba27
Member
- Messages
- 273
- Reaction score
- 3
- Points
- 18
Don't know if this can be done or not.
I am using PHPMailer to send emails (I am aware of the 100 email limit).
I want to be able to use smtp to send messages to myself using PHPMailer. Basically, I am making a newspaper that anyone at my school can edit and I want to have a flag button for inappropriate content. I want to get email updates when someone flags an article so I can review it. But I don't want to have to have people to email me from their own email to alert me. I want the email to be automatically sent without a login, and I prefer not to use mailto: . So I use PHPMailer and have it email myself messages so that no user login is required (the site does it for you). However, while it says there is no error, I am not receiving the messages in Roundcube.
Here is my code:
Here I have a function to send mail:
For a fact, I know this function works. I have tested it with other people and they recieved it fine. But when sending to myself, it didn't work. Here is how I called the function:
When I send the mail, I get $winerror as the error message, so no error happened. But I don't receive any emails! I checked my junk too. So what's wrong??
I am using PHPMailer to send emails (I am aware of the 100 email limit).
I want to be able to use smtp to send messages to myself using PHPMailer. Basically, I am making a newspaper that anyone at my school can edit and I want to have a flag button for inappropriate content. I want to get email updates when someone flags an article so I can review it. But I don't want to have to have people to email me from their own email to alert me. I want the email to be automatically sent without a login, and I prefer not to use mailto: . So I use PHPMailer and have it email myself messages so that no user login is required (the site does it for you). However, while it says there is no error, I am not receiving the messages in Roundcube.
Here is my code:
Here I have a function to send mail:
PHP:
<?php
require_once('phpmailer/class.phpmailer.php');
$error = null;
function smtpmailer($to, $subject, $message, $winerror, $failerror) {
global $error;
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "mail.(website blocked)";
$mail->SMTPDebug = 1;
$mail->SMTPAuth = true;
$mail->Port = 25;
$mail->Username = "(username blocked)";
$mail->Password = "(password blocked)";
$mail->SetFrom('(email blocked)', '(website blocked)');
$mail->AddReplyTo("(email blocked)","(website blocked)");
$mail->Subject = $subject;
$mail->Body = $message;
$mail->AddAddress($to, "Our Friend");
if(!$mail->Send()) {
$error = true;
echo $failerror;
} else {
$error = false;
echo $winerror;
}
}
?>
PHP:
smtpmailer("(email blocked)", "FLAG", "Here is why the article was flagged", "A message has been sent to the admins telling them to check on this article. Well done!", "The article was flagged. It may take a while for the admins to find it, as there was an error when the email was sent.");
When I send the mail, I get $winerror as the error message, so no error happened. But I don't receive any emails! I checked my junk too. So what's wrong??