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.

 

Link to comment
Share on other sites

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 = your.email@domain.com, 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

 

Link to comment
Share on other sites

I have the following code

 

<?php

//  $to = "jose@laserwords.com";

$txtEmailto = "software@laserwords.com";

$mail_from = "software@laserwords.com";

$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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

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