Welcome Guest, Not a member yet? Register   Sign In
email sent with no error, but didn't arrived
#1

[eluser]davidino86[/eluser]
hi,
i'm trying to send an email from a form in the contact page with a javascript validation and sent to www.mysite.com/email/send

this is the controller code:

Code:
<?php

Class Email extends Controller
{
    function email()
    {
        parent::Controller();
     $this->load->library('email');
    }

    function send()
    {
        $service = $_POST['service'];
        $date = $_POST['date'];
        $from = $_POST['from'];
        $address_from = $_POST['address_from'];
        $to = $_POST['to'];
        $address_to = $_POST['address_to'];
        $pax= $_POST['pax'];
        $name= $_POST['name'];
        $surname= $_POST['surname'];
        $email= $_POST['email'];
        $note= $_POST['note'];

      
        $config['mailtpye'] = 'html';
        $this->email->from($address_from, $name);
        $this->email->to('[email protected]');
        


        $this->email->subject('preventivo richiesto da limousineuara.comt');
        $this->email->message('

<style>table {font-family:"arial";} td {border:"dotted 1px #000"; height:"60px";}span {color:"#990000";} p {margin:"0"; font-weight:"bold";}</style>


<table width="100%" border="0">
  <tr>
    <td>Date of Service:</td>
    <td>'.$date.'</td>
  </tr>
  <tr>
    <td>Type of Service:</td>
    <td>'.$service.'</td>
  </tr>
  <tr>
    <td>From:<br />
        <span class="desc">(city, airport, port, hotel, train station ...)</span></td>
        <td>'.$from.' </td>
  </tr>
  <tr>
    <td>From Address:</td>
    <td>'.$address_from.'</td>
  </tr>
  <tr>
    <td>To:<br />
        <span class="desc">(city, airport, port, hotel, train station ...)</span></td>
        <td>'.$to.'</td>
  </tr>
  <tr>
    <td>To Address:</td>
    <td>'.$address_to.'</td>
  </tr>
  <tr>
    <td>Number of PAX:</td>
    <td>'.$pax.'</td>
  </tr>
  <tr>
    <td>Name:</td>
    <td>'.$name.'</td>
  </tr>
  <tr>
    <td>Surename:</td>
    <td>'.$surname.'</td>
  </tr>
  <tr>
    <td>email:</td>
    <td>'.$email.'</td>
  </tr>
  <tr>
    <td>Note:</td>
    <td>'.$note.'</td>
  </tr>
</table>');

       if($this->email->send()) {
          redirect(base_url());
       }else{
           echo "Error";
       }

        

    }
}

?&gt;

i don't know why can someone tell where is the error?

thank you
davide
#2

[eluser]brianw1975[/eluser]
couple of things:

did you send this from your localhost machine?

if so, then it probably didn't even leave your machine as most ISPs block port 25 as a security precaution to reduce spam.

if not, what domain did you send it TO? If yahoo.com, do you have domainkeys set up for your domain? have you checked the recipients spam folder? have you verified that your own domain is not on a blacklist somewhere?
#3

[eluser]davidino86[/eluser]
yes! it's the third one....

the email arrived but in the spam. how can i solve this problem?

thank you so much
#4

[eluser]davidino86[/eluser]
just another thing:

how can i put the html in the message body for the email?

now i try to edit the config.php file like this:

Code:
$config['mailtpye'] = 'html';

but didn't work.
#5

[eluser]davidino86[/eluser]
i solved the problem like this:

in the controller email page:

Code:
$this->load->library('email');

        //for HTML message
        $config_email['mailtype'] = 'html';
        $this->email->initialize($config_email);


hope to help someone in the future.

thanks to brianw1975




Theme © iAndrew 2016 - Forum software by © MyBB