Jump to content

How to Configure SMTP for mailing using PHP


Hemalatha

Recommended Posts

hello,

 

I need to send mail using php Mail(),

1. Our php(I my office) is connect to a remote sever ip is (192.168.5.250).

2. My machine is SMTP enabled.

3. php.ini file is changed in the server folder as per the requirement.

 

but i could not send the mail. plz help me how and where to configure smtp and php.ini file and wat are the other requirement.

 

Thank u very much for the code

i need one more clarification

 

1. our php core is installed in the server IP : 192.168.5.250 is it correct to give this IP address in that INI file for SMTP directive.

2. U have given like send mail_from = [email protected], We have edurao mail client for receiving mail from out client do i have to given that address or my personal mail address

3. give me some examples for send mail_from

 

Waiting for u r reply

 

I have the following code

 

<?php

//  $to = "[email protected]";

$txtEmailto = "[email protected]";

$mail_from = "[email protected]";

$txtSub = "Hello";

$mail_mesg = "Testing for Mail";

  //Check whether the submission is made

if(isset($hidSubmit))

{

//Declarate the necessary variables

$mail_to=$txtEmailto;

$mail_from=$txtEmailfrm;

$mail_sub=$txtSub;

$mail_mesg=$txtMsg;

 

//Check for success/failure of delivery

if(mail($mail_to,$mail_sub,$mail_mesg,"From:$mail_from/r/nReply-to:$mail_from"))

echo "<span class='textred'>E-mail has been sent successfully from $mail_sub to $mail_to</span>";

else

echo "<span class='textred'>Failed to send the E-mail from $mail_sub to $mail_to</span>";

}

else

print "submission not made";

?>

 

 

OUTPUt :

 

Submission not made

 

HELP ME

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.