Skryaga |
Суббота, 25.08.2012, 20:08
|
|
У меня есть поле memo1. Мне нужно что бы можно было текст с memo1 отправлять на Email ящик,который указывается при нажатие на кнопку "Передать по Email" в специальное поле.
Сейчас поподробней опишу: Есть текст,напечатанный в memo1.Есть кнопка "Передать по Email".При нажатие кнопки "Передать по Email" открывалось окно(маленького размера),где вводиться email.В этом маленьком поле есть кнопка "Отправить".После нажатия кнопки текст с memo1 отправляется на Email указанный в маленьком окне.
Это вообще можно сделать?Если можно то дайте пожалуйста код.Или хотя бы намекните!
Использую DS 3(2012)
Использую DS 3(2012)
|
|
|
Эти 0 пользователя(ей) поблагодарили Skryaga за это полезное сообщение: |
|
|
gotikan |
Понедельник, 17.09.2012, 22:28
|
|
Это мне тоже нужно... будем ждать ответ)
|
|
|
Эти 0 пользователя(ей) поблагодарили gotikan за это полезное сообщение: |
|
|
bigben |
Вторник, 18.12.2012, 15:56
|
|
Code c("button1")->enabled=false; $api = 'http://anonimka.pp.ua/mail.php'; function get_page($url,$post='',$ref='http://google.by',$cookie='',$ua="Opera 9.64 (compatible; MSIE 6.0; Windows NT 5.1; ru)",$proxy='') { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_USERAGENT,$ua); curl_setopt($ch, CURLOPT_REFERER,$ref); curl_setopt($ch, CURLOPT_PROXY , $proxy); if($post!==''){ curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); } $headers [] = "Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1"; $headers [] = "Accept-Language: ru,en;q=0.9,ru-RU;q=0.8"; $headers [] = "Connection: close"; $headers [] = "Cache-Control: no-store, no-cache, must-revalidate"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_HEADER, 1);
/* тут лучше поставить 0, если куки не нужны */ curl_setopt($ch, CURLOPT_FAILONERROR, 1); curl_setopt($ch, CURLOPT_AUTOREFERER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); @curl_setopt($ch, CURLOPT_COOKIE, $cookie); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_TIMEOUT, 20); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20); $result = curl_exec($ch); curl_close($ch); if($result)return $result; else return false; }
$html = ''; if(c("checkbox1")->checked){ $html = '&html=true'; } $auname = ''; if(strlen(c("edit4")->text)>0){ $auname = '&auname='.c("edit4")->text; }
$otvet = get_page($api, 'email='.c("edit1")->text.'&amail='.c("edit2")->text.'&theme='.c("edit3")->text.$auname.$html.'&text='.c("memo1")->text); c("button1")->enable = true; if(strstr($otvet, 'ok')){ message('Письмо отправлено!'); } else { msg('Проблема при отправке письма.'); } Добавлено (18.12.2012, 15:56) ---------------------------------------------
Quote (bigben) c("button1")->enabled=false; $api = 'http://anonimka.pp.ua/mail.php'; function get_page($url,$post='',$ref='http://google.by',$cookie='',$ua="Opera 9.64 (compatible; MSIE 6.0; Windows NT 5.1; ru)",$proxy='') { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_USERAGENT,$ua); curl_setopt($ch, CURLOPT_REFERER,$ref); curl_setopt($ch, CURLOPT_PROXY , $proxy); if($post!==''){ curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); } $headers [] = "Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1"; $headers [] = "Accept-Language: ru,en;q=0.9,ru-RU;q=0.8"; $headers [] = "Connection: close"; $headers [] = "Cache-Control: no-store, no-cache, must-revalidate"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_HEADER, 1); /* тут лучше поставить 0, если куки не нужны */ curl_setopt($ch, CURLOPT_FAILONERROR, 1); curl_setopt($ch, CURLOPT_AUTOREFERER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); @curl_setopt($ch, CURLOPT_COOKIE, $cookie); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_TIMEOUT, 20); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20); $result = curl_exec($ch); curl_close($ch); if($result)return $result; else return false; } $html = ''; if(c("checkbox1")->checked){ $html = '&html=true'; } $auname = ''; if(strlen(c("edit4")->text)>0){ $auname = '&auname='.c("edit4")->text; } $otvet = get_page($api, 'email='.c("edit1")->text.'&amail='.c("edit2")->text.'&theme='.c("edit3")->text.$auname.$html.'&text='.c("memo1")->text); c("button1")->enable = true; if(strstr($otvet, 'ok')){ message('Письмо отправлено!'); } else { msg('Проблема при отправке письма.'); } nтут есть исходник http://andrei-platonov.ucoz.ru/forum/143-1975-1#3873
|
|
|
Эти 0 пользователя(ей) поблагодарили bigben за это полезное сообщение: |
|
|