Results 1 to 9 of 9

Thread: Cannot Send Email with PHP

  1. #1
    Guest

    Default Cannot Send Email with PHP

    Hey, I contact you because the e-mail with php not send.

    When I test on local with WAMP on Windows all is ok, but when I do the same thing with the same code on my website the e-mail not send.

    Have you an idea ?

  2. #2
    karl94 is offline AlterVista Staff
    Join Date
    Jan 2015
    Posts
    573

    Default

    On AlterVista you can only send emails by using the PHP email function. Which code are you using?

  3. #3
    Guest

    Default

    Yes, I use this function, I don't know why but sometimes it works,

    I have this code :
    PHP Code:
    $header = "MIME-Version: 1.0\r\n";
    $header.= 'From: "enjoytips"<enjoytipscopyright@gmail.com>'."\n";
    $header.= 'Content-Type:text/html; charset="utf-8"'."\n";
    $header.= 'Content-Transfer-Encoding: 8bit';

    include_once(
    'modele/sujet_bbcode.php');
    $contenu_good = get_contenu_sans_bbc(nl2br(htmlspecialchars($contenu)));

    $message = '
    <html>
    <body>
    Titre : '
    .$titre.'<br />
    Auteur : '
    .$auteur.' ( '.$nom_prenom.')<br />
    Contenu :<br /><br />
    '
    .$contenu_good.'
    </body>
    </html>'
    ;

    mail("enjoytipscopyright@gmail.com", $titre, $message, $header);
    Thanks a lot
    Last edited by karl94; 09-04-2016 at 07:22 PM. Reason: Formattazione

  4. #4
    karl94 is offline AlterVista Staff
    Join Date
    Jan 2015
    Posts
    573

    Default

    You shouldn't use that from header: it will likely trigger every spam filter. Use instead your alias (enjoytips at altervista dot org) in the from header.

  5. #5
    Guest

    Default

    I change the adress like you says but it didn't change anything :/ I really don't know why it works with WAMP in local but not on altervista.

    Sometimes I receive the mails :/

  6. #6
    karl94 is offline AlterVista Staff
    Join Date
    Jan 2015
    Posts
    573

    Default

    It's the mail provider that blocks the mails, from our end it's all sent correctly.

  7. #7
    Guest

    Default

    Yes, but why it works always with WAMP on local and not online ? :/ Have you any idea ?

  8. #8
    karl94 is offline AlterVista Staff
    Join Date
    Jan 2015
    Posts
    573

    Default

    You should ask your mail provider, which is the one blocking the mail.

  9. #9
    Guest

    Default

    Okey, thanks a lot

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

SEO by vBSEO