Tamamlanmış

web form,smtp authentication script mailing problem on windows server

Hi

We have 2 websites,and they hosted on windows 2008 server.

we have two web form and the host needs smtp authentication

we are using PHP script that supports smtp authentication features,

but it is not working correctly and we assume that would be easy job for

the experts to resolve it we don't care about the PHP,You can use ASP if you want.

this is a really a simple task

Thanks

Best Regards

The below email script is for PHP emailing with SMTP authentication.
<?php
//new function
$to = "to@domain.com";
$nameto = "Who To";
$from = "from@domain.com";
$namefrom = "Who From";
$subject = "Hello World Again!";
$message = "World, Hello!";
authSendEmail($from, $namefrom, $to, $nameto, $subject, $message);
?>
<?php
/* * * * * * * * * * * * * * SEND EMAIL FUNCTIONS * * * * * * * * * * * * * */
//This will send an email using auth smtp and output a log array
//logArray - connection,
function authSendEmail($from, $namefrom, $to, $nameto, $subject, $message)
{
//SMTP + SERVER DETAILS
/* * * * CONFIGURATION START * * * */
$smtpServer = "mail.YOUR-DOMAIN.com";
$port = "25";
$timeout = "30";
$username = "your-emaill@domain.com";
$password = "Email password";
$localhost = "mail.YOUR-DOMAIN.com";
$newLine = "
";
/* * * * CONFIGURATION END * * * * */
//Connect to the host on the specified port
$smtpConnect = fsockopen($smtpServer, $port, $errno, $errstr, $timeout);
$smtpResponse = fgets($smtpConnect, 515);
if(empty($smtpConnect))
{
$output = "Failed to connect: $smtpResponse";
return $output;
}
else
{
$logArray['connection'] = "Connected: $smtpResponse";
}
//Request Auth Login
fputs($smtpConnect,"AUTH LOGIN" . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['authrequest'] = "$smtpResponse";
//Send username
fputs($smtpConnect, base64_encode($username) . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['authusername'] = "$smtpResponse";
//Send password
fputs($smtpConnect, base64_encode($password) . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['authpassword'] = "$smtpResponse";
//Say Hello to SMTP
fputs($smtpConnect, "HELO $localhost" . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['heloresponse'] = "$smtpResponse";
//Email From
fputs($smtpConnect, "MAIL FROM: $from" . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['mailfromresponse'] = "$smtpResponse";
//Email To
fputs($smtpConnect, "RCPT TO: $to" . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['mailtoresponse'] = "$smtpResponse";
//The Email
fputs($smtpConnect, "DATA" . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['data1response'] = "$smtpResponse";
//Construct Headers
$headers = "MIME-Version: 1.0" . $newLine;
$headers .= "Content-type: text/html; charset=iso-8859-1" . $newLine;
$headers .= "To: $nameto <$to>" . $newLine;
$headers .= "From: $namefrom <$from>" . $newLine;
fputs($smtpConnect, "To: $to
From: $from
Subject: $subject
$headers

$message
.
");
$smtpResponse = fgets($smtpConnect, 515);
$logArray['data2response'] = "$smtpResponse";
// Say Bye to SMTP
fputs($smtpConnect,"QUIT" . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['quitresponse'] = "$smtpResponse";
}
?>

Hi
We know that HTML5 uses a method that doesn't require any script are you familiar with it
Thanks
Best Regards

Beceriler: .NET, ASP, HTML5, PHP, Web Hosting

Daha fazlasını gör: problem websites, asp experts, best php script, windows 2008, windows server task server, resolve server, simple asp websites, simple task script, windows script 2008, simple smtp script, smtp windows server 2008, web authentication, windows server web 2008, windows server 2013, windows authentication, features asp script, windows care, best web server windows, windows 2008 smtp, smtp server windows server 2008

İşveren Hakkında:
( 5 değerlendirme ) London, United Kingdom

Proje NO: #4125820

Seçilen:

murtaza1981

Hi hbirjand , I (Myself a senior ASP.NET programmer using C# and VB) have a team having experience of more than 5 years in developing web and mobile applications. I have a team of expert programmers who write robust Daha Fazla

$8 USD / saat
(10 Değerlendirme)
4.1

Bu iş için 5 freelancer ortalamada $13/saat teklif veriyor

toinnisfree

quick pro help. ftp and escrow required.

$35 USD / saat
(527 Değerlendirme)
7.9
PixelManagers

Does you hosting server support classic ASP script? If possible, please provide link to website/page. Thanks!

$10 USD / saat
(200 Değerlendirme)
7.0
Vikaskukki

Hi Hope you are doing good. I am ready to fix email script. I assure you will be happy to see with the work quality what i will doing here. Please check PMB for examples. Thanks

$10 USD / saat
(17 Değerlendirme)
5.2
codeindiadigital

Hi, I'm a freelancer from India. I've more than 4 yrs experience in asp.net. I can do this with in few hours. Please see PM to get my idea on this project. Thank you.

$4 USD / saat
(10 Değerlendirme)
3.6