Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$mail->send()) set to false even when the email is sent #2834

Closed
Knutsford opened this issue Nov 26, 2022 · 4 comments
Closed

$mail->send()) set to false even when the email is sent #2834

Knutsford opened this issue Nov 26, 2022 · 4 comments

Comments

@Knutsford
Copy link

Knutsford commented Nov 26, 2022

if (!$mail->send()) {	
	if (trim($Emails) !== "") {
		$Emails = $Emails . ",<br>";
	}
	$Emails = $Emails . trim($Email) .  " - Message was not sent - Mailer Error: " . $mail->ErrorInfo;	
} 

I that inside a loop

The first email it is sending to fails which I am expecting but the next one thinks $mail->send() is also false even though the email is getting sent.

Is that a bug or what can I do about it so the one that is sent isn't going through and hitting $Emails = $Emails . trim($Email) . " - Message was not sent - Mailer Error: " . $mail->ErrorInfo;

$mail->ErrorInfo; contains the error from the first email address if that helps

Thanks

@Synchro
Copy link
Member

Synchro commented Nov 27, 2022

I can't tell without seeing the rest of your code, but I would step through it in a debugger to see why it's getting there.

@Knutsford
Copy link
Author

Knutsford commented Nov 27, 2022 via email

@Synchro
Copy link
Member

Synchro commented Nov 27, 2022

It's not set to false, it returns false, indicating something went wrong with the send process. Set $mail->SMTPDebug = 2 so you can see what's going on. Again, I can't do anything without seeing your code.

@Knutsford
Copy link
Author

Knutsford commented Nov 28, 2022 via email

@Synchro Synchro closed this as completed Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants