mail_send

The Contact Form 7 - Infusionsoft Add-on mail send function.

Description

mail_send( $m ); 

Parameters (1)

0. $m
The m.

Usage

  1. if ( !function_exists( 'mail_send' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'contact-form-7-infusionsoft-add-on/src/xmlrpc-3.0/demo/server/server.php'; 
  3.  
  4. // The m. 
  5. $m = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = mail_send($m); 
  9.  

Defined (1)

The function is defined in the following location(s).

/src/xmlrpc-3.0/demo/server/server.php  
  1. function mail_send($m) 
  2. global $xmlrpcerruser, $xmlrpcBoolean; 
  3. $err=""; 
  4.  
  5. $mTo=$m->getParam(0); 
  6. $mSub=$m->getParam(1); 
  7. $mBody=$m->getParam(2); 
  8. $mFrom=$m->getParam(3); 
  9. $mCc=$m->getParam(4); 
  10. $mBcc=$m->getParam(5); 
  11. $mMime=$m->getParam(6); 
  12.  
  13. if ($mTo->scalarval()=="") 
  14. $err="Error, no 'To' field specified"; 
  15.  
  16. if ($mFrom->scalarval()=="") 
  17. $err="Error, no 'From' field specified"; 
  18.  
  19. $msghdr="From: " . $mFrom->scalarval() . "\n"; 
  20. $msghdr.="To: ". $mTo->scalarval() . "\n"; 
  21.  
  22. if ($mCc->scalarval()!="") 
  23. $msghdr.="Cc: " . $mCc->scalarval(). "\n"; 
  24. if ($mBcc->scalarval()!="") 
  25. $msghdr.="Bcc: " . $mBcc->scalarval(). "\n"; 
  26. if ($mMime->scalarval()!="") 
  27. $msghdr.="Content-type: " . $mMime->scalarval() . "\n"; 
  28. $msghdr.="X-Mailer: XML-RPC for PHP mailer 1.0"; 
  29.  
  30. if ($err=="") 
  31. if (!mail("",  
  32. $mSub->scalarval(),  
  33. $mBody->scalarval(),  
  34. $msghdr)) 
  35. $err="Error, could not send the mail."; 
  36.  
  37. if ($err) 
  38. return new xmlrpcresp(0, $xmlrpcerruser, $err); 
  39. else 
  40. return new xmlrpcresp(new xmlrpcval("true", $xmlrpcBoolean));