473,795 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Email doesn't send using phpmailer class via SMTP

vivekgs2007
60 New Member
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 6724
Atli
5,058 Recognized Expert Expert
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
vivekgs2007
60 New Member
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
vivekgs2007
60 New Member
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 Recognized Expert Expert
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
vivekgs2007
60 New Member
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(INTRANE T)...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
15537
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 list SUBJECT: Free Type
15
4317
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
2663
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 requests from php? Any thoughts on this anybody?
5
2591
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 a shopping basket system which adds all of the totals up and puts them into a nice looking invoice. What's the best way to take this HTML and put it into an email?
11
1866
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 our exchange server to send the mail but am getting an "Unable to relay" message. But the "From" name is my email address, which is obviously on our exchange server, so there is no relay. The message I get back is:
1
12584
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 error when I'm trying to use phpMailer: Mailer Error: Language string failed to load: recipients_failed Does anyone konw the reason for this error?
3
4162
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 on Linux?
11
3521
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 programs capabilities. Searching this forum I did not find any related information so if I have chosen poorly, I would appreciate a suggestion of a more appropriate dotnet forum. Now what I wish is the ability to send bcc's rather than to: (would be...
2
4293
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 any thouhgts on how to get it in as an attachment. CODE: <?php ini_set(SMTP, "172.18.1.65");
14
8364
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 guide me to get it work? Regards
0
10443
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10216
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10165
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9044
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6783
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5565
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.