Jump to content
  • 0

mail sms php


13DureX
 Share

Question

Нужно с помощью пхп отправлять смс через имейл вместе с письмом, которое идет на почту, пишу код вида,

function sendbusinesscontact($option) {
global $database;
global $Itemid;
global $mosConfig_db;
global $er_viewing_notify;
global $mosConfig_live_site;
global $er_bizname;
global $mosConfig_usecaptcha;
define ( "CAPTCHA_PATH", "includes" );
$stVal = 0;
if ($mosConfig_usecaptcha == "1" && file_exists ( CAPTCHA_PATH . "/captcha.php" )) {
session_name ( "mos_captcha" );
session_start ();
$rLead = mosgetparam ( $_POST, "spamstop", "" );
if (isset ( $_SESSION ['code'] ) && $_SESSION ['code'] != "" && $_SESSION ['code'] == $rLead) {
$stVal = 1;
} else {
$stVal = 2;
}
}
if ($stVal != "2") {
$sapptname = $_POST ['apptname'];
$sapptmail = $_POST ['apptmail'];
$mtlp = $_POST ['telephone'];
$sdatein = $_POST ['datein'];
$sdateout = $_POST ['dateout'];
$sold = $_POST ['old'];
$schldrn = $_POST ['children'];
$sdatetime = $_POST ['datetime'];
$id = intval ( $_POST ['id'] );
if (! check_email ( $sapptmail )) {
echo "<script> alert('" . _EZREALTY_EMAIL_FORMAT_ERROR . "'); window.history.go(-1); </script>n";
} else {
$sqlx = "SELECT a.*, cc.name AS category, ee.ezcity AS proploc, ee.ezcity_desc AS ezdesc, dd.name AS statename, bb.name AS countryname, u.mid AS mid, u.dealer_name AS dealer_name, u.dealer_company AS dealer_company, u.dealer_phone AS dealer_phone, rntu.dealer_mobile AS dealer_mobile, u.dealer_sms AS dealer_sms, u.show_sms AS show_sms, u.dealer_image AS dealer_image, u.dealer_type AS dealer_type, u.logo_image AS logo_image FROM #__ezrealty as an LEFT JOIN #__ezrealty_catg AS cc ON cc.cid = a.cidn LEFT JOIN #__ezrealty_locality AS ee ON ee.locid = a.locidn LEFT JOIN #__ezrealty_state AS dd ON dd.stid = a.stidn LEFT JOIN #__ezrealty_country AS bb ON bb.cnid = a.cnidn LEFT JOIN #__ezrealty_profile AS u ON u.mid = a.owner" . ("n WHERE a.published = '1' AND a.id = " . $id);
$database->setquery ( $sqlx );
$database->loadobject ( $thisdbmysql );
$val = stripslashes ( $er_bizname ) . " " . _EZREALTY_INSPECTION;
$mVal = $sapptname . " " . _EZREALTY_REQUEST_PROPVIEWING . "r n";
$mVal .= _EZREALTY_MAIL_PROPADD1 . "rn" . _EZREALTY_MAIL_CONTACTDET . "rn" . _EZREALTY_MAIL_PROPADD3 . "rnrn";
$mVal .= _EZREALTY_MAIL_EMAIL . (" " . $sapptmail . " rn ");
$mVal .= _EZREALTY_TELEPHONE . (" " . $mtlp . " rn ");
$mVal .= _EZREALTY_DATEIN . (" " . $sdatein . " rn ");
$mVal .= _EZREALTY_DATEOUT . (" " . $sdateout . " rn ");
$mVal .= _EZREALTY_OLD . (" " . $sold . " rn ");
$mVal .= _EZREALTY_CHILDREN . (" " . $schldrn . " rn ");
$mVal .= _EZREALTY_DATETIME . (" " . $sdatetime . " rnrn");
$mVal .= _EZREALTY_MAIL_PROPADD1 . "rn" . _EZREALTY_MAIL_LISTDET . "rn" . _EZREALTY_MAIL_PROPADD3 . "rnrn";
$mVal .= _EZREALTY_DET_ADDNUM . (" " . $id . " rnrn ");
$mVal .= _EZREALTY_REQUEST_FOLLOWLINK . "r n";
$mVal .= $mosConfig_live_site . ("/index.php?option=com_ezrealty&Itemid=" . $Itemid . "&task=detail&id={$id} rnrn");
$mVal .= _EZREALTY_BROKENLINK_WARNING . "r n";
$mVal .= _EZREALTY_MAIL_PROPADD1 . "rn" . _EZREALTY_MAIL_PROPADD2 . "rn" . _EZREALTY_MAIL_PROPADD3 . "r n";
$mVal .= $thisdbmysql->unit_num . " " . $thisdbmysql->street_num . " " . $thisdbmysql->address2 . " rn ";
$mVal .= $thisdbmysql->proploc . " " . $thisdbmysql->postcode . " rn ";
$mVal .= $thisdbmysql->statename . " rn ";
$mVal .= $thisdbmysql->countryname . " rn ";
$mmVal = "From: " . $er_viewing_notify . "rn";
$mmVal .= "Reply-To: " . $sapptmail . "rn";
$mmVal .= "X-Priority: 1rn";
$mmVal .= "X-MSMail-Priority: Highrn";
$mmVal .= "X-Mailer: EZ Realty Real Estate Softwarern";
mail("+380663732106@sms.mts.com.ua","test message","From: stealth@alumplast.com.ua","-fstealth@alumplast.com.ua");
$msMail = mosmail ( $er_viewing_notify, $sapptname, $er_viewing_notify, $val, $mVal, 0 );

$email = '+380663732106@sms.mts.com.ua';
$subj = 'uvedomlenie';
$headers = 'Content-Type: text/html; charset=windows-1251rnMIME-Version: 1.0 rnFrom: support@xxx.com rnReturn-Path: support@xxx.com rnReply-To: support@xxx.com rnX-Mailer: XXXX';
$msg = 'text text text text text ';

@mail($email, $subj, $msg, $headers);

ezemailheader ();
ezclose ();
ezemailfooter ();



}
} else {
echo "<SCRIPT> alert('" . _EZREALTY_SECURITY_FAILED . "'); window.history.go(-1);</SCRIPT>";
}

Как видно в коде 2 варианта, какой их них правильный я даже незнаю, может кто поможет?

вот они -

1-й

mail("+380663732106@sms.mts.com.ua","test message","From: stealth@alumplast.com.ua","-fstealth@alumplast.com.ua");

2-й

$email = '+380663732106@sms.mts.com.ua';
$subj = 'uvedomlenie';
$headers = 'Content-Type: text/html; charset=windows-1251rnMIME-Version: 1.0 rnFrom: support@xxx.com rnReturn-Path: support@xxx.com rnReply-To: support@xxx.com rnX-Mailer: XXXX';
$msg = 'text text text text text ';

@mail($email, $subj, $msg, $headers);

С ящика отправляю на 380663732106@sms.mts.com.ua - смска уходит, как это имплантировать с помощью пхп? Заранее благодарен

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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.

 Share

×
×
  • 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. See more about our Guidelines and Privacy Policy