Computer Webmaster Gaming Console Graphics Forum

Welcome to the Computer Webmaster Gaming Console Graphics Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

MK PitStop Main Earn $25 Earn Money Posting Extras Members Blogs Image Hosting User Pages
Go Back   Computer Webmaster Gaming Console Graphics Forum > Webmaster Forum > Website Coding > Pear
Register FAQ/Rules Become A V.I.P. Member Search Today's Posts Mark Forums Read

Pear Pear programming, this is a very complex subject as with using pear with php can be a difficult task for some, so lets talk pear.

Google
Closed Thread
 
LinkBack Thread Tools Display Modes
Old 05-20-2007, 6:34 PM   #1
Ben Wylie
 
Ben Wylie's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Mail Factory - specify different MAIL FROM address to the From header

I am using PEAR's Mail::Factory to send an email from a feedback form on
my website.

I am getting it to send an email via my mail server, using smtp
authentication.
I would like to send an email with the following headers:

From:
To:
Subject:
Sender:

I would like the From address to be user defined, via a form they fill
out, however, when the email is actually sent, I would like it to use a
different address for the MAIL FROM command.

So for example:

A user fills out a web form from the address:

webuser@hotmail.tld

I would like the headers to be:

From: webuser@hotmail.tld
To: destination@gmail.tld
Subject: Website Feedback
Sender: phpuser@mydomain.tld

I would like the email to be sent with the command:
MAIL FROM:<phpuser@mydomain.tld>

On this info page:
http://pear.php.net/manual/en/packag....mail.send.php
in the example it says to use:

$mail_object->send($recipients, $headers, $body);

So when you send the email, there doesn't seem to be a way to specify
the MAIL FROM command, it must take it directly out of the headers you
give it - ie from the From: Header.

Is there a way in which I can specify a MAIL FROM address which is
different from the From address in the headers?

Thanks for your help,
Ben
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Advertisements
Old 05-20-2007, 6:34 PM   #2
Justin Patrin
 
Justin Patrin's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default [PEAR] Mail Factory - specify different MAIL FROM address to the From header

On 4/26/07, Ben Wylie <pear@benwylie.co.uk> wrote:
> I am using PEAR's Mail::Factory to send an email from a feedback form on
> my website.
>
> I am getting it to send an email via my mail server, using smtp
> authentication.
> I would like to send an email with the following headers:
>
> From:
> To:
> Subject:
> Sender:
>
> I would like the From address to be user defined, via a form they fill
> out, however, when the email is actually sent, I would like it to use a
> different address for the MAIL FROM command.
>
> So for example:
>
> A user fills out a web form from the address:
>
> webuser@hotmail.tld
>
> I would like the headers to be:
>
> From: webuser@hotmail.tld
> To: destination@gmail.tld
> Subject: Website Feedback
> Sender: phpuser@mydomain.tld
>
> I would like the email to be sent with the command:
> MAIL FROM:<phpuser@mydomain.tld>
>
> On this info page:
> http://pear.php.net/manual/en/packag....mail.send.php
> in the example it says to use:
>
> $mail_object->send($recipients, $headers, $body);
>
> So when you send the email, there doesn't seem to be a way to specify
> the MAIL FROM command, it must take it directly out of the headers you
> give it - ie from the From: Header.
>
> Is there a way in which I can specify a MAIL FROM address which is
> different from the From address in the headers?
>


Hmmm...if there isn't a way to do it yet I'd say that perhaps it
should be using the values in the authentication options if they're
specified. Then again, perhaps it is done this way because a mail
server won't allow you to do such a thing.

A work-around may be to set the Reply-To header to what you want the
"from" address to be.

--
Justin Patrin
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 05-20-2007, 6:34 PM   #3
Ben Wylie
 
Ben Wylie's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default [PEAR] Mail Factory - specify different MAIL FROM address tothe From header

Justin Patrin wrote:
> On 4/26/07, Ben Wylie <pear@benwylie.co.uk> wrote:
>> I am using PEAR's Mail::Factory to send an email from a feedback form on
>> my website.
>>
>> I am getting it to send an email via my mail server, using smtp
>> authentication.
>> <snip>
>>
>> Is there a way in which I can specify a MAIL FROM address which is
>> different from the From address in the headers?
>>

>
> Hmmm...if there isn't a way to do it yet I'd say that perhaps it
> should be using the values in the authentication options if they're
> specified. Then again, perhaps it is done this way because a mail
> server won't allow you to do such a thing.
>
> A work-around may be to set the Reply-To header to what you want the
> "from" address to be.


You're right about the work-around, I was wondering if it would be
possible to do it the other way so it isn't so obvious.

In fact a mailserver will allow you to do these things.
Once you have authenticated yourself with a mail server, it will let you
send an email to and from any address, so this shouldn't determine any
of your headers or your MAIL FROM address.

Google does it this way for gmail, so you can specify a different From:
email address but it will put in the Sender: header specifying your
gmail account and will use your gmail account in the MAIL FROM command.
This way spam filtering mechanisms like SPF are still met, as the MAIL
FROM address can be an address that is allowed to send an email from
that server.
If you are just sending emails out from any old address via my server,
if the domains for these addresses specify their SMTP servers in SPF,
the recipient may reject the email due to my ip address not matching the
servers in their SPF record.

It would be nice if you could do it like this:
$mail_object->send($recipients, $mailfrom, $headers, $body);

If the $mailfrom is not there, it uses the From header, but if it is
there, it uses that address in the MAIL FROM command.

Thanks
Ben
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 05-20-2007, 6:34 PM   #4
Ben Wylie
 
Ben Wylie's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Mail Factory - specify different MAIL FROM address to the Fromheader

Justin Patrin wrote:
> On 4/26/07, Ben Wylie <pear@benwylie.co.uk> wrote:
>> I am using PEAR's Mail::Factory to send an email from a feedback form on
>> my website.
>>
>> I am getting it to send an email via my mail server, using smtp
>> authentication.
>> <snip>
>>
>> Is there a way in which I can specify a MAIL FROM address which is
>> different from the From address in the headers?
>>

>
> Hmmm...if there isn't a way to do it yet I'd say that perhaps it
> should be using the values in the authentication options if they're
> specified. Then again, perhaps it is done this way because a mail
> server won't allow you to do such a thing.
>
> A work-around may be to set the Reply-To header to what you want the
> "from" address to be.


You're right about the work-around, I was wondering if it would be
possible to do it the other way so it isn't so obvious.

In fact a mailserver will allow you to do these things.
Once you have authenticated yourself with a mail server, it will let you
send an email to and from any address, so this shouldn't determine any
of your headers or your MAIL FROM address.

Google does it this way for gmail, so you can specify a different From:
email address but it will put in the Sender: header specifying your
gmail account and will use your gmail account in the MAIL FROM command.
This way spam filtering mechanisms like SPF are still met, as the MAIL
FROM address can be an address that is allowed to send an email from
that server.
If you are just sending emails out from any old address via my server,
if the domains for these addresses specify their SMTP servers in SPF,
the recipient may reject the email due to my ip address not matching the
servers in their SPF record.

It would be nice if you could do it like this:
$mail_object->send($recipients, $mailfrom, $headers, $body);

If the $mailfrom is not there, it uses the From header, but if it is
there, it uses that address in the MAIL FROM command.

Thanks
Ben
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Featured Websites
Free Space
Free Space
Free Space Free Space
Closed Thread
Tags: , , , , ,




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Script to do a form submition to e-mail. mythikal Website Coding 7 10-26-2008 7:10 AM
GOOD e-mail account ? modric Web Site Hosting 22 05-19-2007 12:36 PM
Need help in E-Mail marketing marriane Website Reviews And Website Questions 2 07-17-2006 4:28 AM
Basic Usage Of Php Mail Function Whatcha PHP 3 05-11-2006 2:46 AM


Featured Websites




All times are GMT +1. The time now is 6:29 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Cheap Computers
MK PitStop Copyright 2005 - 2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98