application/controllers/Common.php
/* function for sending email while user connect to sherpa */
function for sending email while user connect to sherpa
function for sending email while user connect to sherpa
function sherpaConnectMail($user_name,$email,$idealMovingDate,$noOfBedroom,$budget,$query_submmited)
    {      
		$msg= '<html>
              <head></head>
                <body style="color: black;">
                  <p>The following app user has requested Sherpa consultation:<br></p>
                  <p> Name: '.$user_name.'</p>
                  <p> Email address: '.$email.'</p>
                  <p> Moving Date: '.$idealMovingDate.'</p>
				  <p> Number of Bedrooms: '.$noOfBedroom.'</p> 
                  <p> Budget: '.$budget.'</p>
                  <p> Query submitted on: '.$query_submmited.'</p><br><br>
                  <p>Cheers,<br>UrbanCo Tech Team<br>
                  </p>         
                <body>
        </html> '; 
          $mail = new PHPMailer(true); 
          $mail->IsSMTP(); 
        try{
	          $mail->IsHTML(true);      
	          $mail->SMTPDebug = 1;                                                        
	          $mail->Host = "smtp.googlemail.com"; 
	          $mail->Port = "587"; 
	          $mail->SMTPAuth = true; 
	          $mail->Username = "urbancotech@gmail.com"; 
	          $mail->Password = "TheUrbanCollective"; 
	          $mail->SMTPSecure  = 'tls'; 
	          $mail->SetFrom("urbancotech@gmail.com",'TheUrbanCollective');
	          $mail->Subject = "Sherpa request via mobile app";
	          $mail->Body = $msg;         
	          $mail->AddAddress('mayank.mathur@theurbancollective.io');
	          $send = $mail->Send(); 
	          if($send){
	              return true;
	          }else{
	              return false;
	          }
          } catch (phpmailerException $e) {
          			return false;
			} catch (Exception $e) {
			  	return false;
			}
    }
function sherpaConnectMail ( $ user_name , $ email , $ idealMovingDate , $ noOfBedroom , $ budget , $ query_submmited ) { $ msg = '<html>
              <head></head>
                <body style="color: black;">
                  <p>The following app user has requested Sherpa consultation:<br></p>
                  <p> Name: ' . $ user_name . '</p>
                  <p> Email address: ' . $ email . '</p>
                  <p> Moving Date: ' . $ idealMovingDate . '</p>
				  <p> Number of Bedrooms: ' . $ noOfBedroom . '</p> 
                  <p> Budget: ' . $ budget . '</p>
                  <p> Query submitted on: ' . $ query_submmited . '</p><br><br>
                  <p>Cheers,<br>UrbanCo Tech Team<br>
                  </p>         
                <body>
        </html> ' ; $ mail = new PHPMailer ( true ) ; $ mail -> IsSMTP ( ) ; try { $ mail -> IsHTML ( true ) ; $ mail -> SMTPDebug = 1 ; $ mail -> Host = " smtp.googlemail.com " ; $ mail -> Port = " 587 " ; $ mail -> SMTPAuth = true ; $ mail -> Username = " urbancotech@gmail.com " ; $ mail -> Password = " TheUrbanCollective " ; $ mail -> SMTPSecure = 'tls' ; $ mail -> SetFrom ( " urbancotech@gmail.com " , 'TheUrbanCollective' ) ; $ mail -> Subject = " Sherpa request via mobile app " ; $ mail -> Body = $ msg ; $ mail -> AddAddress ( 'mayank.mathur@theurbancollective.io' ) ; $ send = $ mail -> Send ( ) ; if ( $ send ) { return true ; } else { return false ; } } catch ( phpmailerException $ e ) { return false ; } catch ( Exception $ e ) { return false ; } }
function for sending email while user connect to sherpa
function for sending email while user connect to sherpa
//echo $msg;exit(); // include the class name         // create a new object //Hostname of the mail server  ssl://smtp.googlemail.com //Port of the SMTP like to be 25, 80, 465 or 587  ////465 //Whether to use SMTP authentication //Username for SMTP authentication any valid email created in your domain  bamgude.sachin@gmail.com //Password for SMTP authentication  //    $mail->SetFrom("bamgude.sachin@gmail.com"); //To //$mail->AddBCC('mayank.mathur@theurbancollective.io');//whom to send mail  	          // $mail->AddCC(""); //Send the mails //echo $mail->ErrorInfo;exit(); //print_r($mail->ErrorInfo);exit(); // $this->response(array('ResponseCode' => 0, 'ResponseMessage' => 'FAILURE', 'Comments' => 'MAIL SENDING FAIL','Result'=>$send), 400); // $this->response(array('ResponseCode' => 0, 'ResponseMessage' => 'FAILURE', 'Comments' => 'MAIL SENDING FAIL','Result'=>$send), 400);