473,763 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem sending mail using phpMailer class

2 New Member
Hello,
can u help me sending Email with attachments using the Class phpMailer.

On the website I have a link to an html form in which I input the parameters with the names 1)from(textbox name) 2)To 3) Subject 4) Message5) File input(name abc) - to be sent as an attachment.
This form calls the Class PhpMailer through another form with the following code to send the mail.

<?php
ini_set("includ e_path", "http://www.urovisionho spital.com/class.phpmailer .php");

require("class. phpmailer.php") ;

$mail = new PHPMailer();

$mail->From = $_GET["from"];
$mail->FromName = "Mailer";
$mail->AddAddress($_G ET["to"]);
$mail->AddAddress($_G ET["to"]); // name is optional
$mail->AddReplyTo("pr asenjit.sandily a@gmail.com", "Informatio n");

$mail->WordWrap = 50; // set word wrap to 50 characters
$mail->AddAttachment( $_GET["abc"]); // add attachments
$mail->AddAttachment( "/tmp/image.jpg", "new.jpg"); // optional name
$mail->IsHTML(true) ; // set email format to HTML

$mail->Subject = $_GET["subject"];
$mail->Body = $_GET["message"];
$mail->AltBody = "This is the body in plain text for non-HTML mail clients";

if(!$mail->Send())
{
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}

echo "Message has been sent";
?>



RESULT:-The mail is sent but without the parameters and also without the attachment.

Please if u could see to correcting the above coding to retrieve the values of the first HTML form into the second php form quoted above in rder to succesfully send the email message with the attachment.
Thanking u,more so if its done.
May 9 '07 #1
2 4557
Atli
5,058 Recognized Expert Expert
I have a rather limited knowledge of this particular class, but I would think you would have to specify the smtp host, or somehing like that.

This is the official tutorial for the class
May 10 '07 #2
code green
1,726 Recognized Expert Top Contributor
RESULT:-The mail is sent but without the parameters and also without the attachment.
I would guess that you have phpMailer working OK but problems with your form variables
May 10 '07 #3

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

Similar topics

4
15533
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
4312
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.
14
9079
by: Christophe Cerbourg | last post by:
hi, Bonjour, I'm using PHPMailer class to send mails and it works fine for HTML ones. But I can't manage to send correctly a text formatted mail... I tried this : - $message = "first line*\n*second line"; - $message = "first line*\r\n*second line"; - $message = "first line*".chr(13).chr(10)*second line";
6
2662
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?
3
1669
by: at | last post by:
Hi, I need to test a mail function through my IPS, who doesn't allow sending mail without a password. Where do I specify this password? In php.ini I can specify SMTP and sender, but apparently not password. Jakob
2
7635
by: mrbadboy | last post by:
Hi, I tried to send a mail with PHPMail class. Its sending properly if i write the attachment file name directly( I have mentioned my code bellow) $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = "192.168.111.111"; $mail->SMTPAuth = true; $mail->Username = "";
7
9824
by: undbund | last post by:
Hi I am creating a newsletter system. The software should run from desktop computer (localhost) but be able to send email to anyone on the internet. Can you guys give me some ideas on how to achieve this. Thanks
14
1804
by: Jeff | last post by:
I'm writing my php "form mail" script. Does mail do any checking for header injection in the "to" and "subject" parameters? CR and/or LF? It seems to me it easily could and should, but does it? Jeff
0
9563
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9938
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
9822
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8822
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...
1
7366
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5270
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
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
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

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.