Jump to content

sending email help


narjis

Recommended Posts

Hi,

I want to send an email to my registered users so that when they click on the URL given in the message hey should come back to my site as confirmetion of their registration. I am able to send the mail but the mail body is not coming as expected. Here's my code

<?php
   public function email($id){
        //get users info
       $this->userInfo = $this->model->listUser($id);
       $this->sendEmail($this->userInfo);
    }
    public function sendEmail($data){
       
        $to =$data['email'];
        
        
        $this->msg ="<img src=\"ideas.kpjit.com/public/images/header-img.jpg\" />

          <h1>KPJ Idea</h1>
          <p>Make a difference</p>
                <p>This is a Confirmation Mail.Please confirm your registration
            by clicking here <a href=\"http://ideas.kpjit.com\register\confirm\
                    <?php echo $this->data['id'];?></p>\" ";
        
        $subject = "Registration confirmation";
        $message = $this->msg;
        $from ="narjisfatima@yahoo.com";
        $headers  = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
        $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
        $headers .= 'From:narjisfatima@yahoo.com' . "\r\n";
        if(mail($to,$subject,$headers)){
     
        $this->render2("register/message");
        exit;
        }
    }

 

Also I am unable to insert my site banner in the mail. How can I do It.

Link to comment
Share on other sites

try this:

$this->msg ="<img src=\"http://ideas.kpjit.com/public/images/header-img.jpg\" />

          <h1>KPJ Idea</h1>
          <p>Make a difference</p>
                <p>This is a Confirmation Mail.Please confirm your registration
            by clicking here <a href=\"http://ideas.kpjit.com\register\confirm\".$this->data['id']."</p>\" ";

Link to comment
Share on other sites

why am i not getting any message in my mail body i've tried the last message nothing is appearing in mail accept this

 

MIME-Version: 1.0

Content-type: text/html; charset=iso-8859-1

From:narjisfatima@yahoo.com

 


$this->msg ='<img src=\"http://ideas.kpjit.com/public/images/header-img.jpg\" />
          <h1>KPJ Idea</h1>
          <p>Make a difference</p>
                <p>This is a Confirmation Mail.Please confirm your registration
            by clicking here <a href=\"http://ideas.kpjit.com\register\confirm\"'.$this->data['id'].'"</p>\" "';
     
        $subject = "Registration confirmation";
        $message = $this->msg;
        $from ="narjisfatima@yahoo.com";
     
        $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
        $headers .= 'From:narjisfatima@yahoo.com' . "\r\n";
        if(mail($to,$subject,$headers)){
     
        $this->render2("register/message");
        exit;
        }

shall I remove the headers

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.