SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: On Emails

  1. #1
    SitePoint Member
    Join Date
    May 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    On Emails

    Hi,
    In my code i have to send mail when they cancelled mail by clicking on cancel radio button...............

  2. #2
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,496
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hi, welcome

    firstly I dont quite understand your question, a bit more info wouldnt go amiss, secondly we need to see what part your having problems with so post your code.
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming

  3. #3
    SitePoint Member
    Join Date
    May 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    we have three pages in yourleaves.php,leave.php and leavestatus.php pages.In yourleaves.php page we will display whether it has approved or rejected status.
    And in leave page we are mail formate and in leave status page we are having cancel radio button if we click this radio button mail has to come to that person who has cancelled leave as leave has canceled and i tried below one and i am nt getting where to apply exactly
    leavestatus.php
    ----------------
    if($leave_fetch['cancel']==0) {
    ?>
    <? if(($leave_fetch['tlead_approval']!=0) && ($leave_fetch['manager_approval']!=1)) { ?>
    <tr align="center">
    <td>&nbsp;</td>
    <td align="left" class="tahoma11boldblack">For Cancellation</td>
    <td><strong>/strong></td>
    <td align="left" class="verdananormal_blue1">
    <input type="radio" name="cancel" value="1" />Cancel
    </td>
    <td>&nbsp;</td>
    </tr>
    <? } ?>
    <?php } ?>

    <tr><td>&nbsp;</td></tr>

    <tr>
    <td height="25" colspan="5" align="left" valign="top">
    <?php if($leave_fetch['cancel']==0) {
    ?>
    <? if($leave_fetch['manager_approval']!=1){
    ?>
    <input type="submit" name="search" id="submit" value="Submit" class="but"/>
    <?php } ?>
    <?php } ?>
    <input type="button" name="search1" id="back" value="Back" onclick="history.back();" class="but"/>
    </td>
    </tr>
    leave.php
    ---------
    if(isset($reason)) {
    $Subject = "Leave Request";
    //echo $Subject;exit;
    $vHTMLBody = "<table width=100% border=0 cellspacing=0 cellpadding=0 align='left'>
    <tr><td bgcolor=939683 colspan='2'>&nbsp;</td></tr>
    <tr><td height=4 colspan='2'></td></tr>
    <tr><td height=1 bgcolor=939683 colspan='2'></td></tr>
    <tr><td height=8 colspan='2'></td></tr>
    <tr><td align='center' bgcolor='#FFFFFF' colspan='2'>
    <font face=verdana size='2' color='#0ba8b8'><strong>&nbsp;".$Subject."</strong></font>
    </td></tr>
    <tr><td height=8 colspan='2'></td></tr>
    <tr>
    <td class='tahoma11boldblack'>Name</td>
    <td align='left' valign='middle' nowrap bgcolor='#FFFFFF'>
    <font face=verdana size='2' color='#0ba8b8'>&nbsp;".ucwords($fuser['f_name'])."&nbsp;".$fuser['l_name']."</font>
    </td>
    </tr>
    <tr>
    <td class='tahoma11boldblack'>Position</td>
    <td align='left' valign='middle' nowrap bgcolor='#FFFFFF'>
    <font face=verdana size='2' color='#0ba8b8'>&nbsp;".$fetch_position['position_name']."</font>
    </td>
    </tr>
    <tr>
    <td class='tahoma11boldblack'>Department</td>
    <td align='left' valign='middle' nowrap bgcolor='#FFFFFF'>
    <font face=verdana size='2' color='#0ba8b8'>&nbsp;".$fetch_department['department_name']."</font>
    </td>
    </tr>
    <tr>
    <td class='tahoma11boldblack'>Leave From/on</td>
    <td align='left' valign='middle' nowrap bgcolor='#FFFFFF'>
    <font face=verdana size='2' color='#0ba8b8'>&nbsp;".$_REQUEST['from']."</font>
    </td>
    </tr>";
    if($_REQUEST['to'] != ''){
    $vHTMLBody .= "<tr>
    <td class='tahoma11boldblack'>Leave To</td>
    <td align='left' valign='middle' nowrap bgcolor='#FFFFFF'>
    <font face=verdana size='2' color='#0ba8b8'>&nbsp;".$_REQUEST['to']."</font>
    </td>
    </tr>";
    }
    if(isset($halfday)){
    $vHTMLBody .= "<tr>
    <td class='tahoma11boldblack'>Time</td>
    <td align='left' valign='middle' nowrap bgcolor='#FFFFFF'>
    <font face=verdana size='2' color='#0ba8b8'>&nbsp;".$_REQUEST['from_time']."&nbsp;-&nbsp;".$_REQUEST['to_time']."[Half Day Leave]</font>
    </td>
    </tr>";
    }
    $vHTMLBody .= "<tr>
    <td class='tahoma11boldblack'>Reason For Leave</td>
    <td align='left' valign='middle' nowrap bgcolor='#FFFFFF'>
    <font face=verdana size='2' color='#0ba8b8'>&nbsp;".$_REQUEST[reason]."</font>
    </td>
    </tr>
    <tr><td height=8></td></tr>
    <tr><td height=2 bgcolor=#939683 colspan='9'></td></tr>
    <tr><td height=6></td></tr>
    <tr><td height=1 bgcolor=#939683 colspan='9'></td></tr>
    <tr><td height=4></td></tr>
    <tr><td height=1 bgcolor=#939683 colspan='9'></td></tr>
    <tr><td height=8></td></tr>
    </table>";
    /*echo $vHTMLBody;
    echo "<br>";
    exit;*/


    $SmtpAuth = 0; // 1 For IsSMTP() and 0 For IsMail()
    $mail = new PHPMailer();

    if($SmtpAuth == 1)
    {
    $mail->IsMail();
    }
    else
    {
    $mail->IsSmtp();
    $mail->Host = $rs_settings[smtphost]; // specify main and backup server
    $mail->SMTPAuth = true; // turn on SMTP authentication
    $mail->Username = $rs_settings[smtp_username]; // SMTP username
    $mail->Password = $rs_settings[smtp_password];
    }
    $mail->FromName = $fuser['f_name'];
    //echo $fuser['email'];exit; // From Address
    $mail->From = $fuser['email'];
    //echo $mail->AddAddress['pavani.karanam@itpeoplecorp.in'];exit;// From Address
    $mail->AddAddress($fadmin['email']); // To Address
    $mail->IsHTML(true);// set email format to HTML
    $mail->Subject = $Subject;
    $mail->Body = $vHTMLBody;
    //$mail->Send();
    //echo $fadmin['email'];exit;
    $send_address = $fadmin['email'];
    $headers = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    $headers .= "Content-Transfer-Encoding: 8bit\r\n";
    // This two steps to help avoid spam
    //echo $fuser['f_name'];exit;
    $headers .= "From:".$fuser['f_name']."\r\n";
    //$headers .= "Cc:". $accdata[email] . "\r\n";
    $headers .= "Message-ID: <".gettimeofday()." TheSystem@".$_SERVER['SERVER_NAME'].">\r\n";
    $headers .= "X-Mailer: PHP v".phpversion()."\r\n";

    mail($send_address, $Subject, $vHTMLBody, $headers);

    }
    /////////////////////////////////////// end of php mailer ////////////////////////////////
    header("location:leave.php?send");

    }


    include "includes/header.php";

    ?>


Bookmarks

Posting Permissions

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