Home

Forums

Web development

 

 

 

 
     
 
dna88 Web development and Technology Forum
 
Profile   Register   Memberlist   Usergroups   FAQ   Search  Log in
can't send mail using mail Function of PHP

 
Post new topic   Reply to topic    dna88 Forum Index -> Web scripting language Discussion Forum
Author Message
tanveer
User
User


Joined: 21 Jun 2004
Posts: 85
Location: Dhaka,Bangladesh

Post Post subject: can't send mail using mail Function of PHP Reply with quote

Hello,
I want all of your help here with mail function. I have a feedback form where users will send their feedback about the website but I cant make that page send mail to my accout in yahoo.
Here is the code of feedback.php:
Code:

<form name="feedback" METHOD="POST" action="feedback.php">
  <td valign="top">
       
       <table width="610" height="249" style="border:0px solid #b4b4b4" cellspacing="0" cellpadding="0" align="left">
       <tr>
         <td width="38%" height="29"><div align="left"><img src="images/feedback.png" width="215" height="22">
   </div></td>
         <td width="62%">&nbsp;</td>
       </tr>
       <tr class="style5">
         <td height="24"><span class="style13"> Name </span></td>
         <td><input type="text" name="name" value="" maxlength="35" style="border:1px solid #000000"></td>
       </tr>
       <tr class="style5">
         <td height="24"><span class="style13">Telephone</span></td>
         <td><input type="text" name="telephone" value="" maxlength="35" style="border:1px solid #000000"></td>
       </tr>
  <tr class="style5">
         <td height="24"><span class="style13">Email</span></td>
         <td><input type="text" name="email" value="" maxlength="35" style="border:1px solid #000000"></td>
       </tr>
  <tr class="style5">
         <td height="24"><span class="style13">Comments</span></td>
         <td><textarea name="comments"  style="border:1px solid #000000"></textarea></td>
       </tr>
 <tr class="style5">
         <td height="17">&nbsp;</td>
         <td>&nbsp;</td>
       </tr>
 <tr class="style5">
         <td align="center" height="35"><input type="submit" value="Submit" name="submit"></td>
         <td align="left"><input type="reset" value="Reset" name="reset"></td>
       </tr>
       <tr class="style5">
         <td height="24" colspan="2" align="center"><img src="images/div.png" width="611" height="19"></td>
         </tr>
     </table>        </td>
 </form>


here is the feedback.php code:
Code:

<?php
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= "From: <$EmailAddress2>" . "\r\n";

// Send
$to="tanveer_t2002@yahoo.com";
$subject="subject";
$message="this is body";

mail($to, $subject, $message, $headers);
     echo " sent";
?>


Am I missing something here ? Do I have to configure anything in mailserver or something?

Thanks in advance.
-Tanveer
Thu Oct 20, 05 9:37 am
Back to top
tanveer View user's profile Send private message
tanveer
User
User


Joined: 21 Jun 2004
Posts: 85
Location: Dhaka,Bangladesh

Post Post subject: Reply with quote

Finally this made me send a mail in PHP.

//This part is code for mailing [feedback.php]
Code:

  $from =  "Tanvir <tanvir@yahoo.com >";
  $to_mail = tanveer_t2002@yahoo.com
  $message = "Hello Admin,<br>Here is a Request mail from user .
       
  $subject = "Request Mail From User";
  $headers = "From: $from \r\n";
 
  $headers .= "MIME-Version: 1.0\n" . "Content-type: text/html; charset=iso-8859-1";
  $message = stripslashes($message);
 
  mail($to_mail, $subject, $message, $headers);
 


This part is usually configured in hosting side so not my concern.
Code:

//config on php.ini
 
[mail function]
; For Win32 only.
SMTP = mail.dominox.com ; for Win32 only
smtp_port = 25
sendmail_from= tanveer_t2000@yahoo.com ; for Win32 only
 
//end of config
Mon Dec 12, 05 6:54 am
Back to top
tanveer View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    dna88 Forum Index -> Web scripting language Discussion Forum All times are GMT - 7 Hours
Page 1 of 1

 

Partners and Resources

Bangladesh hosting company

Bangladesh web design

Driven by phpBB © phpBB Group