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 -
$mail_date = date("d-m-Y");
-
//$to = "info@eitech.in";
-
$to = "user@example.com";
-
$subject = "Feedback posted in www.eitech.in dated".$mail_date;
-
$message = "Name : ".$Name."<br/>"."Address: ".$Address."<br/>"."Email : ".$Email."<br/>"."Fax: ".$Fax."<br/>"."Message :".$Message."<br/>";
-
$from = $Email;
-
$headers = "From: .$from";
-
mail($to,$subject,$message,$headers);
-
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/>";
-
The link of the site page is http://www.eitech.in/prj_feedback.php
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.
@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...
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.
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...
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 -
require_once('class.phpmailer.php');
-
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
-
$mail_date = date("d-m-Y");
-
$body = file_get_contents('contents.html');
-
$body = eregi_replace("[\]",'',$body);
-
$mail = new PHPMailer(); // defaults to using php "mail()"
-
-
-
-
-
-
$mail->SMTPAuth = true; // enable SMTP authentication
-
//$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
-
$mail->Host = "smtp.eitech.in"; // sets GMAIL as the SMTP server
-
$mail->Port = 25;
-
$mail->Username = "username";
-
$mail->Password = "password";
-
-
-
$mail->IsHTML(true);
-
-
$mail->SetFrom($Email, 'First Last');
-
-
-
-
$address = "swd@eitech.in";
-
$mail->AddAddress($address, "vivek");
-
-
$mail->Subject = "PHPMailer Test Subject via mail(), basic";
-
-
//$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
-
-
$mail->MsgHTML($body);
-
-
-
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/>";
-
-
check it here... http://www.eitech.in/prj_feedback.php Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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,...
|
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...
|
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...
|
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
...
|
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,...
|
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.
...
|
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....
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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)...
|
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...
|
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
|
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...
| |