send email with database information

View: New views
9 Messages — Rating Filter:   Alert me  

send email with database information

by alfredo ventura :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi friends .. I'm creating a web application in php in the Internet and reading I found this very interesting tool (PHPMailer).

I was in the task of running the script for this tool and to adjust to my web application.

The idea is that through PHPMailer were sent from a client and can be sent by mail. The problem is that customer information is stored in a database, and when I run the script just send me the HTML and not sentences or instructions that are in PHP, so that only sends a table with headings but no information customer.

I can do to make it work ...

I leave here the script that sends email
http://pastebin.com/m2260c8af

earlier within the script file is named: carteras.php 
the script is as follows.
http://pastebin.com/m6ffd70e5

I appreciate your help in advance .. Blessings


Manuel Hernandez




--
Manuel Hernandez

------------------------------------------------------------------------------

_______________________________________________
Phpmailer-general mailing list
Phpmailer-general@...
https://lists.sourceforge.net/lists/listinfo/phpmailer-general

Re: send email with database information

by Chris Weiss-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Jun 29, 2009 at 10:35 AM, alfredo ventura<malfred192@...> wrote:

> Hi friends .. I'm creating a web application in php in the Internet and
> reading I found this very interesting tool (PHPMailer).
>
> I was in the task of running the script for this tool and to adjust to my
> web application.
>
> The idea is that through PHPMailer were sent from a client and can be sent
> by mail. The problem is that customer information is stored in a database,
> and when I run the script just send me the HTML and not sentences or
> instructions that are in PHP, so that only sends a table with headings but
> no information customer.
>
> I can do to make it work ...
>
> I leave here the script that sends email
> http://pastebin.com/m2260c8af
>
> earlier within the script file is named: carteras.php
> the script is as follows.
> http://pastebin.com/m6ffd70e5
>
> I appreciate your help in advance .. Blessings
>
>
> Manuel Hernandez
>
>
>
>
> --
> Manuel Hernandez
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Phpmailer-general mailing list
> Phpmailer-general@...
> https://lists.sourceforge.net/lists/listinfo/phpmailer-general
>
>

use the same concepts as printing to the browser, but instead of echo,
contact the email body as a string

------------------------------------------------------------------------------
_______________________________________________
Phpmailer-general mailing list
Phpmailer-general@...
https://lists.sourceforge.net/lists/listinfo/phpmailer-general

Parent Message unknown Re: send email with database information

by Chris Weiss-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Jun 29, 2009 at 10:46 AM, alfredo ventura<malfred192@...> wrote:
> Thanks for your help, but really do not understand very well what you mean
> ... Could be explained?

try to reply on the list...

all phpmailer does is email a string.  you have to build the string first.

------------------------------------------------------------------------------
_______________________________________________
Phpmailer-general mailing list
Phpmailer-general@...
https://lists.sourceforge.net/lists/listinfo/phpmailer-general

Parent Message unknown Re: send email with database information

by Chris Weiss-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Jun 29, 2009 at 11:15 AM, alfredo ventura<malfred192@...> wrote:

> The information sent by email is obtained from the database, If I create a
> string with this information, if the sentence would have to use php echo.
>
> I have about a month trying to send such information by email but I failed.
>
> Well wait your answer. Thank you very much .. Blessings
>
> 2009/6/29 Chris Weiss <cweiss@...>
>>
>> On Mon, Jun 29, 2009 at 10:46 AM, alfredo ventura<malfred192@...>
>> wrote:
>> > Thanks for your help, but really do not understand very well what you
>> > mean
>> > ... Could be explained?
>>
>> try to reply on the list...
>>
>> all phpmailer does is email a string.  you have to build the string first.
>
>
>
> --
> Manuel Hernandez
>

again, reply to the list or i stop answering.

echo has nothing to do with it.  build a string instead of using echo.

------------------------------------------------------------------------------
_______________________________________________
Phpmailer-general mailing list
Phpmailer-general@...
https://lists.sourceforge.net/lists/listinfo/phpmailer-general

Re: send email with database information

by alfredo ventura :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The information sent by email is obtained from the database, If I create a string with this information, if the sentence would have to use php echo.

I have about a month trying to send such information by email but I failed.

Well wait your answer. Thank you very much .. Blessings

2009/6/29 Chris Weiss <cweiss@...>
On Mon, Jun 29, 2009 at 11:15 AM, alfredo ventura<malfred192@...> wrote:
> The information sent by email is obtained from the database, If I create a
> string with this information, if the sentence would have to use php echo.
>
> I have about a month trying to send such information by email but I failed.
>
> Well wait your answer. Thank you very much .. Blessings
>
> 2009/6/29 Chris Weiss <cweiss@...>
>>
>> On Mon, Jun 29, 2009 at 10:46 AM, alfredo ventura<malfred192@...>
>> wrote:
>> > Thanks for your help, but really do not understand very well what you
>> > mean
>> > ... Could be explained?
>>
>> try to reply on the list...
>>
>> all phpmailer does is email a string.  you have to build the string first.
>
>
>
> --
> Manuel Hernandez
>

again, reply to the list or i stop answering.

echo has nothing to do with it.  build a string instead of using echo.



--
Manuel Hernandez

------------------------------------------------------------------------------

_______________________________________________
Phpmailer-general mailing list
Phpmailer-general@...
https://lists.sourceforge.net/lists/listinfo/phpmailer-general

Re: send email with database information

by Jonathan Schwartz-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Alfredo,

You will need to brush up on your PHP.

Both the "echo" and "print" commands output to the screen only.

For each email yo send, you need to build a "string" in PHP, consisting of your base email content plus data from the database. You then set the body of the Phpmailer parameter to the value of the string. You will need to loop through the multiple records. 
Hope that helps

J



Jonathan Schwartz
Exit 445 Group
415-370-5011

On Jun 29, 2009, at 12:20 PM, alfredo ventura <malfred192@...> wrote:

The information sent by email is obtained from the database, If I create a string with this information, if the sentence would have to use php echo.

I have about a month trying to send such information by email but I failed.

Well wait your answer. Thank you very much .. Blessings

2009/6/29 Chris Weiss <cweiss@...>
On Mon, Jun 29, 2009 at 11:15 AM, alfredo ventura<malfred192@...> wrote:
> The information sent by email is obtained from the database, If I create a
> string with this information, if the sentence would have to use php echo.
>
> I have about a month trying to send such information by email but I failed.
>
> Well wait your answer. Thank you very much .. Blessings
>
> 2009/6/29 Chris Weiss <cweiss@...>
>>
>> On Mon, Jun 29, 2009 at 10:46 AM, alfredo ventura<malfred192@...>
>> wrote:
>> > Thanks for your help, but really do not understand very well what you
>> > mean
>> > ... Could be explained?
>>
>> try to reply on the list...
>>
>> all phpmailer does is email a string.  you have to build the string first.
>
>
>
> --
> Manuel Hernandez
>

again, reply to the list or i stop answering.

echo has nothing to do with it.  build a string instead of using echo.



--
Manuel Hernandez
------------------------------------------------------------------------------
_______________________________________________
Phpmailer-general mailing list
Phpmailer-general@...
https://lists.sourceforge.net/lists/listinfo/phpmailer-general

------------------------------------------------------------------------------

_______________________________________________
Phpmailer-general mailing list
Phpmailer-general@...
https://lists.sourceforge.net/lists/listinfo/phpmailer-general

Re: send email with database information

by alfredo ventura :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

PHPMailer friends, with the help of Jim and his blog http://blog.unijimpe.net/ can solve the problem as follows.

At line 10 of code changes
$ body = file_get_contents ( 'carteras.php');

by

$ body = file_get_contents ( 'http://localhost/webbalinsa/opciones/cliente/carteras.php');

so that it sends all the information on the page ...

I hope this will help many users from the list of PHPMailer, I help a lot and finally after 2 months was wondering .. I could do ..

You can see the code in: http://pastebin.com/m60105a39

Blessings.

2009/6/29 Jonathan Schwartz <jonathan@...>
Alfredo,

You will need to brush up on your PHP.

Both the "echo" and "print" commands output to the screen only.

For each email yo send, you need to build a "string" in PHP, consisting of your base email content plus data from the database. You then set the body of the Phpmailer parameter to the value of the string. You will need to loop through the multiple records. 
Hope that helps

J



Jonathan Schwartz
Exit 445 Group
415-370-5011

On Jun 29, 2009, at 12:20 PM, alfredo ventura <malfred192@...> wrote:

The information sent by email is obtained from the database, If I create a string with this information, if the sentence would have to use php echo.

I have about a month trying to send such information by email but I failed.

Well wait your answer. Thank you very much .. Blessings

2009/6/29 Chris Weiss <cweiss@...cweiss@...>
On Mon, Jun 29, 2009 at 11:15 AM, alfredo ventura<malfred192@...malfred192@...> wrote:
> The information sent by email is obtained from the database, If I create a
> string with this information, if the sentence would have to use php echo.
>
> I have about a month trying to send such information by email but I failed.
>
> Well wait your answer. Thank you very much .. Blessings
>
> 2009/6/29 Chris Weiss <cweiss@...cweiss@...>
>>
>> On Mon, Jun 29, 2009 at 10:46 AM, alfredo ventura<malfred192@...malfred192@...>
>> wrote:
>> > Thanks for your help, but really do not understand very well what you
>> > mean
>> > ... Could be explained?
>>
>> try to reply on the list...
>>
>> all phpmailer does is email a string.  you have to build the string first.
>
>
>
> --
> Manuel Hernandez
>

again, reply to the list or i stop answering.

echo has nothing to do with it.  build a string instead of using echo.



--
Manuel Hernandez
------------------------------------------------------------------------------
_______________________________________________
Phpmailer-general mailing list
Phpmailer-general@...
https://lists.sourceforge.net/lists/listinfo/phpmailer-general



--
Manuel Hernandez

------------------------------------------------------------------------------

_______________________________________________
Phpmailer-general mailing list
Phpmailer-general@...
https://lists.sourceforge.net/lists/listinfo/phpmailer-general

Re: send email with database information

by Chris Weiss-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Jun 29, 2009 at 3:14 PM, alfredo ventura<malfred192@...> wrote:

> PHPMailer friends, with the help of Jim and his blog
> http://blog.unijimpe.net/ can solve the problem as follows.
>
> At line 10 of code changes
> $ body = file_get_contents ( 'carteras.php');
>
> by
>
> $ body = file_get_contents (
> 'http://localhost/webbalinsa/opciones/cliente/carteras.php');
>
> so that it sends all the information on the page ...
>
> I hope this will help many users from the list of PHPMailer, I help a lot
> and finally after 2 months was wondering .. I could do ..
>
> You can see the code in: http://pastebin.com/m60105a39
>
> Blessings.
>
> 2009/6/29 Jonathan Schwartz <jonathan@...>
>>
>> Alfredo,
>> You will need to brush up on your PHP.
>> Both the "echo" and "print" commands output to the screen only.
>> For each email yo send, you need to build a "string" in PHP, consisting of
>> your base email content plus data from the database. You then set the body
>> of the Phpmailer parameter to the value of the string. You will need to loop
>> through the multiple records.
>> Hope that helps
>> J
>>
>>
>> Jonathan Schwartz
>> Exit 445 Group
>> 415-370-5011
>> On Jun 29, 2009, at 12:20 PM, alfredo ventura <malfred192@...>
>> wrote:
>>
>> The information sent by email is obtained from the database, If I create a
>> string with this information, if the sentence would have to use php echo.
>>
>> I have about a month trying to send such information by email but I
>> failed.
>>
>> Well wait your answer. Thank you very much .. Blessings
>>
>> 2009/6/29 Chris Weiss <cweiss@...>
>>>
>>> On Mon, Jun 29, 2009 at 11:15 AM, alfredo ventura<malfred192@...>
>>> wrote:
>>> > The information sent by email is obtained from the database, If I
>>> > create a
>>> > string with this information, if the sentence would have to use php
>>> > echo.
>>> >
>>> > I have about a month trying to send such information by email but I
>>> > failed.
>>> >
>>> > Well wait your answer. Thank you very much .. Blessings
>>> >
>>> > 2009/6/29 Chris Weiss <cweiss@...>
>>> >>
>>> >> On Mon, Jun 29, 2009 at 10:46 AM, alfredo
>>> >> ventura<malfred192@...>
>>> >> wrote:
>>> >> > Thanks for your help, but really do not understand very well what
>>> >> > you
>>> >> > mean
>>> >> > ... Could be explained?
>>> >>
>>> >> try to reply on the list...
>>> >>
>>> >> all phpmailer does is email a string.  you have to build the string
>>> >> first.
>>> >
>>> >
>>> >
>>> > --
>>> > Manuel Hernandez
>>> >
>>>
>>> again, reply to the list or i stop answering.
>>>
>>> echo has nothing to do with it.  build a string instead of using echo.
>>
>>
>>
>> --
>> Manuel Hernandez
>>
>>
>> ------------------------------------------------------------------------------
>>
>> _______________________________________________
>> Phpmailer-general mailing list
>> Phpmailer-general@...
>> https://lists.sourceforge.net/lists/listinfo/phpmailer-general
>
>
>
> --
> Manuel Hernandez
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Phpmailer-general mailing list
> Phpmailer-general@...
> https://lists.sourceforge.net/lists/listinfo/phpmailer-general
>
>

I'd just like to note (for those future readers) that while this
method will work, it's a complete hack and needlessly causes an extra
http session for each email sent on your server's workload.  As
Jonathan said, brush up on your php...

------------------------------------------------------------------------------
_______________________________________________
Phpmailer-general mailing list
Phpmailer-general@...
https://lists.sourceforge.net/lists/listinfo/phpmailer-general

Parent Message unknown Re: send email with database information

by alfredo ventura :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Bill ... actually, I had problems with PHPMailer, but jim (ciberamigo) helped me solve the problem.

For my part I am more than grateful for the assistance given, and not in vain to see this message.

I've always said, what I say and I will say it is good to have friends like you, who are always willing to help us chickens or small we think every day to grow and become better people ..

If there is any doubt do not hesitate to look at you


Bill thank you very much ... Blessings

2009/7/2 bill gates <billgates1_6052001@...>
Hello friend,
 
the only way i can help you is if you can send me the link so that i can try it and then i can retify the problem.Hoping to hear from you soon
 
Bill

--- On Mon, 6/29/09, alfredo ventura <malfred192@...> wrote:

From: alfredo ventura <malfred192@...>
Subject: Re: [Phpmailer-general] send email with database information
To: phpmailer-general@...
Date: Monday, June 29, 2009, 12:20 PM

The information sent by email is obtained from the database, If I create a string with this information, if the sentence would have to use php echo.

I have about a month trying to send such information by email but I failed.

Well wait your answer. Thank you very much .. Blessings

2009/6/29 Chris Weiss <cweiss@...>
On Mon, Jun 29, 2009 at 11:15 AM, alfredo ventura<malfred192@...> wrote:
> The information sent by email is obtained from the database, If I create a
> string with this information, if the sentence would have to use php echo.
>
> I have about a month trying to send such information by email but I failed.
>
> Well wait your answer. Thank you very much .. Blessings
>
> 2009/6/29 Chris Weiss <cweiss@...>
>>
>> On Mon, Jun 29, 2009 at 10:46 AM, alfredo ventura<malfred192@...>
>> wrote:
>> > Thanks for your help, but really do not understand very well what you
>> > mean
>> > ... Could be explained?
>>
>> try to reply on the list...
>>
>> all phpmailer does is email a string.  you have to build the string first.
>
>
>
> --
> Manuel Hernandez
>

again, reply to the list or i stop answering.

echo has nothing to do with it.  build a string instead of using echo.



--
Manuel Hernandez

-----Inline Attachment Follows-----

------------------------------------------------------------------------------

-----Inline Attachment Follows-----

_______________________________________________
Phpmailer-general mailing list
Phpmailer-general@...
https://lists.sourceforge.net/lists/listinfo/phpmailer-general




--
Manuel Hernandez

------------------------------------------------------------------------------

_______________________________________________
Phpmailer-general mailing list
Phpmailer-general@...
https://lists.sourceforge.net/lists/listinfo/phpmailer-general