473,406 Members | 2,378 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,406 software developers and data experts.

Email doesn't send using phpmailer class via SMTP

vivekgs2007
HI to all,
I downloaded the Php Mailer Function, I embedded it to my Feedback page, It is not giving any error, But the mail is not going, I don't no where i gone wrong...Please help me in this..
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";   
  14. $mail->Host       = "smtp.bizmail.yahoo.com";  // sets GMAIL as the SMTP server
  15. $mail->Port       = 465;  
  16. $mail->Username = "username"; 
  17. $mail->Password = "password"; 
  18.  
  19.  
  20. $mail->IsHTML(true);    
  21.  
  22. $mail->SetFrom($Email, $Name);
  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.  
If not check it in this link..
http://www.eitech.in/prj_feedback.php
Apr 1 '10 #1
5 6702
Atli
5,058 Expert 4TB
Hey.

Try adding this after line #6:
Expand|Select|Wrap|Line Numbers
  1. $mail->IsSMTP();
  2. $mail->SMTPDebug  = 2;
And make sure you have the error messages turned on.
Apr 1 '10 #2
I added that one, but the mail is not coming,is that any thing change have to be done in php mailer function..
once u check it by giving the feedback..
http://www.eitech.in/prj_feedback.php
Apr 1 '10 #3
Hi Atil,
Finally i got the answer the problem is

Expand|Select|Wrap|Line Numbers
  1. mail($to,$subject,$message);
  2.  
I used this
Expand|Select|Wrap|Line Numbers
  1. mail($to,$subject,$message, $headers);
  2.  
Thank you for concerning me...I will be great full to you...
Apr 2 '10 #4
Atli
5,058 Expert 4TB
Note that the mail() function is not a part of PHPMailer, so if you use it you can remove the PHPMailer include and all of the PHPMailer code.

Using PHPMailer, you send the mail by doing:
Expand|Select|Wrap|Line Numbers
  1. $mail->Send()
Apr 2 '10 #5
ya i removed all the code of php mailer...only mail() i used...now its working perfectly...now i am moving to new project...
Its based on the COMPANY INTERNAL WEBSITE(INTRANET)...I don't no how to do this..Please can u give me some suggestion to me...
Apr 2 '10 #6

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

Similar topics

4
by: James | last post by:
How can I take my form data and send it as an email using my SMTP server located @ my ISP using PHP ? my form has several fields: TO: this is a drop down list FROM: this is a drop down...
15
by: Sven Templin | last post by:
Hello all, our configuration is as following described: - OS: Windows 2000 - Apache server 1.3 - Php 3.8 - MS outlook client 2000 _and_ no SMTP server available in the whole intranet.
6
by: Martin Meng | last post by:
Set up SMTP / smtp_from variable, as suggested in manual. But the mail() function always return fails. I was trying to use smtp.mail.yahoo.com I wonder if yahoo is somehow blocking smtp...
5
by: Ian N | last post by:
Hi, I'm creating a site that posts orders to an email address when they're submitted, these orders need to be in the form of official invoices so i'm using HTML to format them. I already have...
11
by: tshad | last post by:
I have a W2003 server running my website and I am trying to set up my pages to send email using System.Web.Mail. I have pages running on this machine using CDONTS that work fine. I am using...
1
by: Leszek | last post by:
Hi. I have problem with phpMailer 1.73 (windows version) After copying both class.phpmailer and class.smtp and also language file phpmailer.lang-pl to my php include directory im getting this...
3
by: IanReardon | last post by:
Is it possible to configure an external SMTP server to route all of your outgoing mail through on Linux? I know in php.ini there is a parameter, but it says its only for windows? Can I do this...
11
by: Ed Bitzer | last post by:
I have been able using the namespace System.Web.Mail and its method Smtp.mail.send to mail simple text messages to a small group within our 55 and older community. I need help expanding the...
2
by: Erik Witkop | last post by:
So I have been trying to get this to work all day. I can't get a local file on my web server to attach to an email. Right now I have it printing out in the body of the email. Please help me with...
14
by: Warren Tang | last post by:
Hi I am using the mail function to send a mail like this: $b = mail("my_real_email_address@gmail.com", "Hello from PHP", "Hi, finally sent an email successfully"); But it failed. Could you...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.