473,320 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Problem in Sending mail and a responce mail.

vivekgs2007
Hi sir,
I Have created a feedback page in php.Its all working properly.but the problem is that, when any one give the feedback it stores in database, but a mail is not sent to owner...is that i have to configure in phpmailer function in server.. the code is
Expand|Select|Wrap|Line Numbers
  1.         $mail_date = date("d-m-Y");
  2.         //$to = "info@eitech.in";
  3.         $to = "user@example.com";
  4.         $subject = "Feedback posted in www.eitech.in dated".$mail_date;
  5.         $message = "Name : ".$Name."<br/>"."Address: ".$Address."<br/>"."Email : ".$Email."<br/>"."Fax: ".$Fax."<br/>"."Message :".$Message."<br/>";
  6.         $from = $Email;
  7.         $headers = "From: .$from";
  8.         mail($to,$subject,$message,$headers);
  9.         echo "<br/><center><style='font-size:1.2em;color:#0557A9;'>Thank You For Sending The Feedback To Us,<br/>We Will Get Back To You With A solution To Your Query.</center><br/>";
  10.  
The link of the site page is http://www.eitech.in/prj_feedback.php
Mar 29 '10 #1

✓ answered by Atli

The code you are using should work fine. If it isn't working, the server you are using must not be set up to send emails.

then how to configure the phpmailer function in my server
You must not confuse the mail() function and PHPMailer. They are two completely different things. - The mail() function is just meant to be used to send simple emails on servers with a very simple, standard mail server setup. - The PHPMailer or Swift Mailer classes are much more advanced. They can handle all sorts of server setups and are much more easily configurable and offer much more detailed debugging.

Whatever you do, you need to figure out how your mail server is set up. If it is a basic sendmail or local SMTP server, you may well be able to use the mail() function. - If it is anything more complex, you may want to use PHPMailer (or Swift Mailer) instead.

5 2194
Atli
5,058 Expert 4TB
Hey.

Do you have the error messages turned on?

To use the mail function, you need to have a SMTP server set up. On Linux, there would need to be a sendmail server set up. On Windows, a SMTP server. Also, on Windows you may need to alter the "SMTP" and "smtp_port" directives in the "php.ini" file to match the values for your STMP server.

If using a local server is not an option, you may want to consider upgrading to one of the mailer classes, such as PHPMailer or Swift Mailer. They are generally easier to work with.
Mar 29 '10 #2
@Atli
Sir if i used in localhost..i need to configure smtp mailer...i used directly in the server by uploading..then how to configure the phpmailer function in my server...
sir the code is correct na sir...
Mar 29 '10 #3
Atli
5,058 Expert 4TB
The code you are using should work fine. If it isn't working, the server you are using must not be set up to send emails.

then how to configure the phpmailer function in my server
You must not confuse the mail() function and PHPMailer. They are two completely different things. - The mail() function is just meant to be used to send simple emails on servers with a very simple, standard mail server setup. - The PHPMailer or Swift Mailer classes are much more advanced. They can handle all sorts of server setups and are much more easily configurable and offer much more detailed debugging.

Whatever you do, you need to figure out how your mail server is set up. If it is a basic sendmail or local SMTP server, you may well be able to use the mail() function. - If it is anything more complex, you may want to use PHPMailer (or Swift Mailer) instead.
Mar 29 '10 #4
ok Thank you sir, I Will work on it and if any error comes, I will get back to u,Thank you for giving me a suggestion to me...
Mar 29 '10 #5
Hello sir,
As u told me about the phpmailer, i downloaded and work in that but i am not getting any error in that code, the mail is not sending, please help me in that...here is the code
Expand|Select|Wrap|Line Numbers
  1. require_once('class.phpmailer.php');
  2. //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
  3. $mail_date = date("d-m-Y");
  4. $body             = file_get_contents('contents.html');
  5. $body             = eregi_replace("[\]",'',$body);
  6. $mail             = new PHPMailer(); // defaults to using php "mail()"
  7.  
  8.  
  9.  
  10.  
  11.  
  12. $mail->SMTPAuth   = true;                  // enable SMTP authentication
  13. //$mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
  14. $mail->Host       = "smtp.eitech.in";      // sets GMAIL as the SMTP server
  15. $mail->Port       = 25;  
  16. $mail->Username = "username"; 
  17. $mail->Password = "password"; 
  18.  
  19.  
  20. $mail->IsHTML(true);    
  21.  
  22. $mail->SetFrom($Email, 'First Last');
  23.  
  24.  
  25.  
  26. $address = "swd@eitech.in";
  27. $mail->AddAddress($address, "vivek");
  28.  
  29. $mail->Subject    = "PHPMailer Test Subject via mail(), basic";
  30.  
  31. //$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
  32.  
  33. $mail->MsgHTML($body);
  34.  
  35.  
  36. echo "<br/><center><style='font-size:1.2em;color:#0557A9;'>Thank You For Sending The Feedback To Us,<br/>We Will Get Back To You With A solution To Your Query.</center><br/>";
  37.  
  38.  
check it here...
http://www.eitech.in/prj_feedback.php
Apr 1 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Eric Timely | last post by:
After a trust with exchange server established the xp_SendMail gives the following error: xp_sendmail: failed with mail error 0x80070005 Prior to the trust everything worked fine. I have...
6
by: Mike the Canadian | last post by:
I am having a very strange problem sending email with php. I have two domains. I can send an email to one domain using php but not the other. If I put both email addresses in the mail command only...
8
by: Nadav | last post by:
Hi, Introduction: ********************* I am writing a mixed mode application I have a COM module and a .NET module that communicate with each other. The COM exposes a custom sink interface,...
3
by: VB Programmer | last post by:
I have an ASPX page where I send out emails through my mail server mail.MyDomain.com. When I send emails to MyName@MyDomain.com it sends PERFECTLY. When I try sending an email to any other address...
4
by: splicemix | last post by:
Hi all, I have recently set up a Drupal website. I am a beginner. My shared host server does not allow nobody@localhost to send emails, and prevents access to php.ini, so I spent some time...
4
by: k.visube | last post by:
In my ASP application,i need to send a formatted text mail (i.e with newline characters). here in my application i used a function in javascript which construts the mail body sample snippet ...
3
by: Adriano | last post by:
Hello, I'm developing an application in VB.NET 2005 that communicates with a device through RS232, and need to send the following sequence of hexadecimal data to the device: 0xFF, 0x01, 0xC3,...
2
by: =?Utf-8?B?YmFyYnlxMTA=?= | last post by:
After sending mail, it leaves the outbox as normal and clears and hits the sent folder, but then I get a popup box that states EMAIL PROBLEM One or more e-mail messages cannot be sent. ...
0
Dormilich
by: Dormilich | last post by:
this is a follow-up thread to this one. http://bytes.com/topic/html-css/answers/863662-form-not-submitted-sometimes I figured out that the mail sending class triggers the described error....
2
ThatThatGuy
by: ThatThatGuy | last post by:
Hello reader,, This might be a very simple question, but what to just say about it, i'm facing it Actually i'm developing a web App and i want email feature in that.... I'm sending mail from my...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.