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

Using the mail() function

I'd like to use the $headers field in the mail() function of PHP, but
I'd like to be able to make these variable that somebody could change
in a form.

$headers .= 'To: $to' . "\r\n";
Something like that above.

Thanks,

--TJ
Feb 25 '08 #1
4 1243
te********@gmail.com wrote:
I'd like to use the $headers field in the mail() function of PHP, but
I'd like to be able to make these variable that somebody could change
in a form.

$headers .= 'To: $to' . "\r\n";
Something like that above.

Thanks,

--TJ
Which will open your site as a spam relay, and quickly get your hosting
account canceled.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Feb 25 '08 #2
On Feb 25, 3:51 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
techjoh...@gmail.com wrote:
I'd like to use the $headers field in the mail() function of PHP, but
I'd like to be able to make these variable that somebody could change
in a form.
$headers .= 'To: $to' . "\r\n";
Something like that above.
Thanks,
--TJ

Which will open your site as a spam relay, and quickly get your hosting
account canceled.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
Yeah, I realize that now. But, what about making one of the header
fields a variable? I just don't understand the php syntax well enough
to make this happen.

--JP
Feb 26 '08 #3
te********@gmail.com wrote:
On Feb 25, 3:51 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>techjoh...@gmail.com wrote:
>>I'd like to use the $headers field in the mail() function of PHP, but
I'd like to be able to make these variable that somebody could change
in a form.
$headers .= 'To: $to' . "\r\n";
Something like that above.
Thanks,
--TJ
Which will open your site as a spam relay, and quickly get your hosting
account canceled.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================

Yeah, I realize that now. But, what about making one of the header
fields a variable? I just don't understand the php syntax well enough
to make this happen.

--JP
Read up on single and double quoting strings, for starters. You need
either:

$headers .= "To: $to\r\n";

Or

$headers .= 'To: ' . $to . "\r\n";

Variables are not replaced when in single quotes.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Feb 26 '08 #4
>>$headers .= 'To: $to' . "\r\n";
>>Something like that above.
>Which will open your site as a spam relay, and quickly get your hosting
account canceled.
Yeah, I realize that now. But, what about making one of the header
fields a variable? I just don't understand the php syntax well enough
to make this happen.
First thing to read about is mail injection. If you don't read up on
that, your site will STILL be a spam relay.

Good luck,
--
Willem Bogaerts

Application smith
Kratz B.V.
http://www.kratz.nl/
Feb 26 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Karuna | last post by:
Hi everybody, I have been trying to write a simple mail script using PHP and apache on Windows XP. Eventhough the script is saying that the mail is successfully sent, I am unable get it in my...
4
by: engrkhalid | last post by:
Hello everybody, When I send an email to any Hotmail account it goes directory to the Junk Email! My website is in a dedicated server using: Linux 2.4.21, Apa­che, PHP, MySQL I'm using the...
3
by: vishal | last post by:
i am getting following error. Warning: mail() : Failed to connect to mailserver at "smtp.gmail.com" port 465, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in...
6
by: Rani | last post by:
hi guys I need to send an email from a form the form is collecting data from a user and then submits it to us. I would like the email to appear in the following format Name: Email: Etc. all I...
3
by: Rob | last post by:
Hi all, I am having trouble converting the code below (found on http://vbnet.mvps.org/index.html?code/core/sendmessage.htm) into a format that will work using vb .NET. Can anyone have a look...
6
by: ransoma22 | last post by:
I developing an application that receive SMS from a connected GSM handphone, e.g Siemens M55, Nokia 6230,etc through the data cable. The application(VB.NET) will receive the SMS automatically,...
2
by: bambi | last post by:
I tried sending an E-mail using the MAPISendMail. The mail sits/lies in my outbox as unsent. Then I have to open the E-mail in the outbox, double-click the recipient in the 'TO' box and change the...
7
by: oopsbabies | last post by:
Hello everyone, I am using Apache 1.3.33 as the web server and PHP version 4.3.10. My machine is using Windows XP 2002 professional edition which comes with a Windows firewall. I am using McAfee...
1
by: akuva | last post by:
I have to send more than 100s of email using a php code if i use mail function whether it will be sent to spam or inbox. If it is sent to spam which is the other way to send mass email from php. i...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
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...
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.