انتقادات و پیشنهادات

# Fileds Value
1 نام: $_POST[txtname]
2 ایمیل: $_POST[txtemail]
3 پیام: $_POST[payam]
_END; $text_body= 'nayomad'.$form; $to = "info@adsa.ir"; $from = "parstest@adsa.ir"; $password = "asDFJ83rDFJwq"; $subject = "انتقادات و پیشنهادات از شرکت آدسا"; $contents = $form; PARSDATA_Send_Mail($from,$to,$password,$subject,$contents); $msg='ارسال شد ' ; $to = "adsa.legrand@gmail.com"; $from = "parstest@adsa.ir"; $password = "asDFJ83rDFJwq"; $subject = "انتقادات و پیشنهادات از شرکت آدسا"; $contents = $form; PARSDATA_Send_Mail($from,$to,$password,$subject,$contents); } function PARSDATA_Send_Mail($from, $to,$password, $subject, $message) { mb_convert_encoding($message, "UTF-8"); utf8_encode($message); $namefrom = ""; $nameto = ""; /* your configuration here */ $smtpServer = "87.247.179.180"; //does not accept STARTTLS $port = "25"; // try 587 if this fails $timeout = "45"; //typical timeout. try 45 for slow servers $username = $from; //your gmail account $password = $password; //the pass for your gmail $localhost = $_SERVER['REMOTE_ADDR']; //requires a real ip $newLine = "\r\n"; //var just for newlines /* you shouldn't need to mod anything else */ //connect to the host and port $smtpConnect = fsockopen($smtpServer, $port, $errno, $errstr, $timeout); //echo $errstr." - ".$errno; $smtpResponse = fgets($smtpConnect, 4096); if(empty($smtpConnect)) { $output = "Failed to connect: $smtpResponse"; echo $output; return $output; } else { //$logArray['connection'] = "Connected to: $smtpResponse"; // echo "connection accepted
".$smtpResponse."

Continuing

"; } //you have to say HELO again after TLS is started fputs($smtpConnect, "HELO $localhost". $newLine); $smtpResponse = fgets($smtpConnect, 4096); $logArray['heloresponse2'] = "$smtpResponse"; //request for auth login fputs($smtpConnect,"AUTH LOGIN" . $newLine); $smtpResponse = fgets($smtpConnect, 4096); $logArray['authrequest'] = "$smtpResponse"; //send the username fputs($smtpConnect, base64_encode($username) . $newLine); $smtpResponse = fgets($smtpConnect, 4096); $logArray['authusername'] = "$smtpResponse"; //send the password fputs($smtpConnect, base64_encode($password) . $newLine); $smtpResponse = fgets($smtpConnect, 4096); $logArray['authpassword'] = "$smtpResponse"; //email from fputs($smtpConnect, "MAIL FROM: <$from>" . $newLine); $smtpResponse = fgets($smtpConnect, 4096); $logArray['mailfromresponse'] = "$smtpResponse"; //email to fputs($smtpConnect, "RCPT TO: <$to>" . $newLine); $smtpResponse = fgets($smtpConnect, 4096); $logArray['mailtoresponse'] = "$smtpResponse"; //the email fputs($smtpConnect, "DATA" . $newLine); $smtpResponse = fgets($smtpConnect, 4096); $logArray['data1response'] = "$smtpResponse"; //construct headers $headers = "MIME-Version: 1.0" . $newLine; $headers .= "Content-type: text/html; charset=UTF-8" . $newLine; $headers .= "To: $nameto <$to>" . $newLine; //observe the . after the newline, it signals the end of message fputs($smtpConnect, "To: $to\r\nFrom: $from\r\nSubject: $subject\r\n$headers\r\n\r\n$message\r\n.\r\n"); $smtpResponse = fgets($smtpConnect, 4096); $logArray['data2response'] = "$smtpResponse"; // say goodbye fputs($smtpConnect,"QUIT" . $newLine); $smtpResponse = fgets($smtpConnect, 4096); $logArray['quitresponse'] = "$smtpResponse"; $logArray['quitcode'] = substr($smtpResponse,0,3); fclose($smtpConnect); //a return value of 221 in $retVal["quitcode"] is a success return($logArray); } ?> .::: ADSA .:::. Representative of Legrand in Iran|نظر سنجی :::.

لگراند فرانسه
لگراند فرانسه

:: گالری تصاویر

لطفا نظرات و انتقادات خود را برای ما ارسال کنید تا در خدمت رسانی به شما عزیزان بتوانیم بهترین باشیم







آدسا نماينده رسمي لگراند فرانسه در ايرانDesigned & Powered by Adsa Co.Official Representative of Legrand FRANCE IN IRAN , Copyright 2011