0

Hello world,

I have a problem with sending email in PHP. I was sending many times with the same code, but now it doesn’t work and don’t know why. I’ve contacted with domain helpdesk, but they said that there are all OK and PHP server works properly. Please someone could help me on this issue?

Here is the code
<code>
<?php
// mltiples recipientes
$para = 'arsen@khaarsen.com' . ', '; // note la coma
$para .= 'arsench@khaarsen.com';

// asunto
$asunto = 'Cursos online PGE S.L.';

// mensaje
$mensaje = '
here is the message body

';

// Para enviar correo HTML, la cabecera Content-type debe definirse
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// header
$headers .= 'To: Arsen <arsench2000@gmail.com>' . "\r\n";
$headers = 'From: Cursos online PGE S.L. <noresponder@ginerllinares.com>' . "\r\n"; // this email exists and work

// send
mail($para, $asunto, $mensaje, $headers);
echo"Message sent to <br> $para <br>";
?>
</code>

3
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by Randy Orton
0

Try adding the line

ini_set('display_errors', 1);

(This turns on error reporting)
and see what errors you get back

0

Hello, Thank

You a lot, I’ve added , but no errors was displayed :(

Anyway thank you again.

0

OK then try changing this code

// send
mail($para, $asunto, $mensaje, $headers);
echo"Message sent to <br> $para <br>";
?>

to

// send
if ( !mail($para, $asunto, $mensaje, $headers) ) {
echo "An error occurred, your message was not sent";
} else {
echo"Message sent to <br> $para <br>";
}
?>

If you are still getting "Message sent to..." in your output then the PHP is fine and it could be a problem with the person you are trying to send the email to, the mail server or something else on the server.

0

Thank you again, I’ve tried all the possible options, but its not resolving my issue, I think the best way to change the domain host provider, because from my own web server I can send the message with the same code.

Good day!

0

Email messages may have one or more attachments. Attachments serve the purpose of delivering binary or text files of unspecified size. In principle there is no technical intrinsic restriction in the SMTP protocol limiting the size or number of attachments. In practice, however, email service providers implement various limitations on the permissible size of files or the size of an entire message.Furthermore, due to technical reasons, often a small attachment can increase in size when sent,which can be confusing to senders when trying to assess whether they can or cannot send a file by email, and this can result in their message being rejected bulk email marketing a broadcast email software free is really a cost-effective method.

Edited by Randy Orton: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.