Welcome Guest, Not a member yet? Register   Sign In
Email issues with MediaTemple hosting
#1

[eluser]doubleplusgood[/eluser]
Hi there,

I have a website hosted with MediaTemple that has a CI contact form. I've noticed that when I set the 'to' address as one of the domain email accounts, the enquiry from the contact form is never received.

I know that the form definitely works, because when i change the 'to' address to a non-domain related email address, such as a gmail account - the enquiry from the contact form is received.

Wondered if anyone else had experienced this problem?

My Contact controller is here (Note: I'm using the constants.php file to set SITE_EMAIL and SITE_TITLE);

Code:
function send()
{
    $this->load->library('form_validation');

    // field name, error message, validation rules
    $this->form_validation->set_rules('first_name', 'First Name', 'trim|required|xss_clean');
    $this->form_validation->set_rules('last_name', 'Last Name', 'trim|required|xss_clean');
    $this->form_validation->set_rules('company', 'Company', 'trim|xss_clean');
    $this->form_validation->set_rules('email', 'Email Address', 'trim|required|valid_email');
    $this->form_validation->set_rules('telephone', 'Telephone', 'trim|xss_clean');
    $this->form_validation->set_rules('enquiry', 'Enquiry', 'trim|required');

    if($this->form_validation->run() == FALSE)
    {
        $view_data['title'] = "Contact";
        $view_data['body'] = "contact";
        $view_data['view_file'] = 'contact/index';
        $this->load->view('layouts/layout', $view_data);
    }
    else
    {
        // validation has passed. Now send the email
        $title = $this->input->post('title');
        $firstname = $this->input->post('first_name');
        $lastname = $this->input->post('last_name');
        $company = $this->input->post('company');
        $email = $this->input->post('email');
        $telephone = $this->input->post('telephone');
        $enquiry = $this->input->post('enquiry');
        
        $data['title']=$title;
        $data['firstname']=$firstname;
        $data['lastname']=$lastname;
        $data['company']=$company;
        $data['email']=$email;
        $data['telephone']=$telephone;
        $data['enquiry']=$enquiry;
        $message=$this->load->view('messaging/contact',$data,true);

        $this->load->library('email');
        $config['wordwrap'] = TRUE;
        $config['mailtype'] = 'html';
        $this->email->set_newline("\r\n");
        

        $this->email->initialize($config);

        $this->email->from($email);
        $this->email->to(SITE_EMAIL, SITE_TITLE);
        $this->email->subject('Enquiry');        
        $this->email->message($message);

        if($this->email->send())
        {
            $this->session->set_flashdata('message', "Thank you for contacting us. We will reply to your enquiry within 24 hours.");
            redirect('contact/index');

        }

        else
        {
            $this->session->set_flashdata('message', "Something went wrong. Please try again.");
            redirect('contact/index');
        }            
    }
}
#2

[eluser]tough-sonu[/eluser]
Hi,

I am also having the same problem with media temple. my mails are going to gmail account but can't receive them on the same server or on the other domain on the Media Temple.

for a temp. fix i have made the form to write to a CSV file, but looking for the solution.

Please help!

Regards
#3

[eluser]doubleplusgood[/eluser]
Do you use the Google Hosted solution for your domain emails?
#4

[eluser]tough-sonu[/eluser]
Nope!!

I am hosted on MT and my form sits on the same server, when i try to send it to one of the email on the same server it never reaches.
and with gmail its fine.




Theme © iAndrew 2016 - Forum software by © MyBB