kvarnerexpress
Sep 16 2005, 02:10 PM
I'm trying to send an attachment using the mail Php function. It gets caught by the email server with an error. It seems to have a problem with the separator or who knows what. The server says something like "invalid separator on mime type." The code is: Code: CODE // subject $subject = "Hello There ";
$mime_boundary = "<<<--==-->>>";
// headers $headers = "From: " . 'Tom' . " <" . 'texample@aol.com' . ">\r\n"; $headers .= "Return-Path: " . 'texample@aol.com' . "\r\n"; $headers .= "Reply-To: " . 'texample@aol.com' . "\r\n"; $headers .= "Content-type: Multipart/Mixed;\r\n"; $headers .= "Mime-Version: 1.0\r\n"; $headers .= "X-Mailer: PHP Mailer\r\n"; $headers .= " boundary=\"".$mime_boundary."\"";
// message $message .= "This is a multi-part message in MIME format.\r\n"; $message .= "\r\n"; $message .= $mime_boundary."\r\n";
$message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n"; $message .= "Content-Transfer-Encoding: 7bit\r\n"; $message .= "\r\n"; $message = "Attached is the file "; $message .= "."; $message .= "\n\n"; $message .= $mime_boundary."\r\n"; $message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n"; $message .= " name=\"feedback.txt\"\r\n"; $message .= "Content-Description: Requested File;\r\n"; $message .= " filename=\"feedback.txt\"\r\n"; $message .= "\r\n"; $message .= $mime_boundary."\r\n";
$email = "dianne@aol.com";
// Send if (mail ($email, $subject, $message, $headers)) { echo "<script>alert ('Your email was sent. ')</script>"; } else { echo "<script>alert ('Unable to send your email.')</script>"; } I'm not trying to use the MimeMail class or anything since the version of Php that we're using is not supported by it. I'm just trying to do this using the mail function. The code seems o.k. when compared to others that I have seen. Can't figure out what's going on. Thanks in advance for reading this and any suggestion or solutions. kvarnerexpress
Reply
round
Sep 16 2005, 08:27 PM
asking a very stupid question but does the sever actually allow you to use mail functions, cause this one doesn't. I mean i have tons of scripts that i've used that work like a charm but you should look to php.net and see if there's anything there that will answer you question or fix your problem.round
Reply
moldboy
Sep 16 2005, 10:46 PM
What do you mean the mail function isn't on this server? I've sent mail using php from trap17. Anyway about your question, yes php.net, but more specificaly try: http://ca3.php.net/manual/en/function.mail.php scroll down to the part where the users post Vladimir has posted a message that may pertain to you.
Reply
Recent Queries:--
php email attachments - 7.99 hr back. (1)
-
sending attachments in php - 8.24 hr back. (1)
-
sending attchment in php - 8.38 hr back. (1)
-
php script email with image attachment - 11.44 hr back. (1)
-
send attachment using mail in php - 13.52 hr back. (1)
-
using php mail to send attachments - 17.39 hr back. (1)
-
email text file attachment php - 20.49 hr back. (1)
-
php send attachments back to back - 23.22 hr back. (1)
-
free send mail using form with attachment - 27.72 hr back. (1)
-
email:sending attachments with php - 28.38 hr back. (1)
-
how to send attachment using php - 28.59 hr back. (1)
-
send attachment more user through mail using php - 28.61 hr back. (1)
-
how to send attachment in mail using php - 30.45 hr back. (1)
-
mail php include attachment - 30.65 hr back. (1)
Similar Topics
Keywords : sending, attachments, email, function, php
- PHP Function To Add Previous and Next Page Feature
useful php function (0)
Sending E-mails Based On Intervals?
(7) Again, I need your help. I have two database entries, let's say "reg_users" and "news". The
question is that if somethings was changed in the "news" database, the email letter will be sent
automatically to all emails which are related to "reg-users" database. So, how can I accomplish this
point. How can I set this process based on daily, weekly or monthly basis?....
Sending E-mails After News Update?
Coding needed?!? (8) I need the following code or the idea how to reach this concept. Let's say, I have a database
entry which is called "news", where all of the news stories are stored. If this database entry got
modified, like the new post was added to the web-site by an administrator, the registered users will
get some kind of email notification automatically, I mean the mails are sent automatically without
the interaction of someone else. ....
Endif function?
(6) As you get noticed before, I am studying PHP in examples like using the tutorials as well as books
itself. Through my readings, I get this function CODE <?php endif; ?> a lot of times.
So, what do you mean by this function, and what does it do exactly?....
An Interesting Approach To Email Verification...
(6) I was thinking just now and I came up with a very interesting solution for email verification.
It's actually based off of how alot of spammers get your email: Dynamic images. You could have
a dynamic image display in the email that activates the account when loading it. The only downfall
to it is if your users are using a an email provider such as Gmail, the images will be blocked, but
I have a solution for that too. You could have the image say "Congratulations your account has been
activated". And then below the image in plain text write "If you do not see the....
Php Email Validation
A PHP data validation class with many functions (1) I've been reading through my old php book (PHP 4.1) and came across this data validation class.
It can check a number of things ranging from telephone numbers , credit card number formats, email
address and some others. I checked out some of the methods although I didnt expect it to work 100%
because I've found source code errors thoughout the book and CD. I tested out a few of the
methods to check and some of them did return expected results but some didnt either so the data
validation class was not perfect and it didnt really bother me. The cool thing I found....
Arrays Outside A Function
Need to have arrays available to all functions. (3) I've got a bunch of arrays that i want to use for more then 1 function. when i declear the
arrays outside a function i cant use it in a function. This code was originally written in
javascript by another person but since I plan to use it and extend it with php I had to change it
from javascript to php code. In the javascript code the arrays were decleared outside the functions
with 'var arrayname' I read somewhere that declearing javascript variables with
'var' gives it global access. Any ideas on how I can go about declearing 1 set of these
arrays t....
Encode Your Email Address
Confuse the Spam Bots, but not your viewing clients (5) Spam bots often 'scrape' pages to glean information and collect email addresses. I don't
like that. To combat the Bots from collecting my address off of my site, I wrote a script that
includes 'obscures' the address in several ways. It adds 'AT' where the '@'
sign is and then replaces the '.' with 'DOT' so it is humanly readable, but not by
the Bots. Also, it encodes the 'mailto' and the address used in the 'mailto' so it
shows okay on the web page and on:hover, but it is actually encode into hex value....
How To Check If Fsockopen Function Is Enabled?
(2) Hi, I have VPS (virtual private server) and I have access to php.ini file. Is there any script that
will show that fsockopen function is enabled or where do I have to enable it? Searched google and
here and couldn't find anything. Thanks! ....
Php Explode Function Help
(4) I am having trouble creating a script, all i want to achieve is to: 1. Select the variable from my
mysql database, which is in a format of : id|id|id|id| and so on... 2. Split them into separate
variables by using : $songexploded = explode("|",$ttyo ); 3. Then this is the bit I'm
stuck on trying to create a while loop from the $songexploded variables. So(this might not be
correct but you should get the idea).. CODE $x=1; while ($songexploded
==$result) echo $songexploded[$x].'<br>'; }....
Trouble With Phpbb Email
(1) Hi guys, I want to know if there is anything you can do for sending confirmation email to your
users automatically when they have just regeistered, when the host server does not support SMTP
(Simple Mail Transfer Protocol). ? Thanks alot.....
Sending $_get[] Variables To An Application
(3) I'm trying to work out if it is possible to send variables to a application on server. E.g
send the variable of id which is equal to 10 to an application - test.exe?id=10 Any ideas to see if
this is possible?....
The Best Zip Function
(1) hi my 6th code is very useful, you can zip your file by this: CODE <? class dZip{ var
$filename; var $overwrite; var $zipSignature =
"\x50\x4b\x03\x04"; // local file header signature var
$dirSignature = "\x50\x4b\x01\x02"; // central dir header signature
var $dirSignatureE= "\x50\x4b\x05\x06"; // end of central dir
signature var $files_count = 0; var $fh; Function
dZip($filename, $overwri....
Mail() Clone
A PHP mail() function clone (5) A lot of free web hosts have disabled the mail() function so you cannot send emails using PHP. Does
anybody know of a script that makes a function "like" mail but is able to be installed in a web
accessible directory and called included into another script and called like that? Or maybe you know
how to make such a function? I just really need to find a way around the free hosts turning of the
mail() function. I need to figure out a way to send emails.....
Email Sending.
email sending with php. (1) this script allow user to send an email for you. i hope you enjoy /wink.gif"
style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /> CODE
[color="#0000ff"][indent]<? $top='<html
dir="rtl"> <head> <meta http-equiv="Content-Language"
content="fa"> <meta http-equiv="Content-Type" content="text/html;
charset=utf-8"> </head> <body> <div
align="center"> <p style="margin-top&....
[php](simple) Using Functions To Combine Values In A Form
Really simple example on how to combine values with function (2) I just learned this simple method on how to use functions to combine two values from a form. First
we create ourselves a simple POST form CODE <form method="POST"> Name:
<input type="text" name="nickname"> Location: <input
type="text" name="location"> <input type="submit"
value="Input"> </form> Now we add this php to that same file CODE
<?php $nick = $_POST['nickname']; $location =
$_POST['location' ....
[php] Header Function
(2) Header function Greetings we are going to use the header() funtion to redirect start making a
file called page.php at the top of the file add CODE <?php ?> Example 1 After
CODE header('Location: http://www.trap17.com'); the LOCATION means
where you want it to go. Example 2 you also can define a file that you want to redirect to After
CODE header('Location: index.php'); Example 3 you also can add a timer to
it /laugh.gif" style="vertical-align:middle" emoid=":lol:" border="0" alt=....
Error With Joomla Template
cant find function (1) Hello! I am working on my template in Dreamweaver and i am using joomla extensions for
dreamweaver! When i start my page with joomla stand alone server(jsas) i get this errors on the
bottom of the page! QUOTE Warning:
mosloadcomponent(w:/www/Joomla/components/com_banner/banner.php) : failed to open stream: No such
file or directory in w:\www\Joomla\includes\frontend.php on line 66 Warning:
mosloadcomponent(w:/www/Joomla/components/com_banner/banner.php) : failed to open stream: No such
file or directory in w:\www\Joomla....
The Extract() Function
Something I just found out (6) The extract() function is used in PHP to take an array and split it up into variables. MySQL
queries can be parsed this way. Below is an example. CODE $query =
mysql_query("select username, password from users where uid=1"); $result =
mysql_fetch_array($query, mysql_assoc); extract($result); print "Your
username is : $username"; The extract() function works for ANY array, including
$_POST, and $_GET. Makes processing form data a LOT easier /biggrin.gif"
style="vertical-align:midd....
How Good Is This Data Cleaning Function?
(2) Hi all, this is my first function and as part of a script and i just want to know a couple of
things. here is the code for the function: CODE <? function
clean($dirty_string) { $muddy_string = stripslashes($dirty_string);
$murky_string = strip_tags($muddy_string); $clean_string =
htmlentities($murky_string); }; ?> So the first thing is how secure is
it? the script this will be used in connects to a database and sends an email so it needs to stop
SQL injections and any email ab....
Add Users On Email Program With Php?
(1) First of all Marry Christmas, Well so i am in some kind of a problem, i can't find out how to
add users to my mail service, i have no idea what SMTP/IMAP program the server runs, neither does
the system administrator. But it should be kinda the same thing for all of them if i am not wrong,
Anyways i have full access to server so i can do whatever i want to do, i have SSH access too (Root
access /rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0"
alt="rolleyes.gif" /> )....
Explode Function Help
need help from you programmers! (1) /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Hi I am robert I
need some help with some php coding. I am stuck with a explode function. Here is the code:
$username = $check ; $query="SELECT `buildings` FROM `authuser` WHERE
`uname` = '$username'"; $result=mysql_query($query);
$result=mysql_result($result,0);
list($building1,$building2,$building3,$building4,$building5,$building6
,$building7,$building8,$building9,....
Email Header Inject Test
(0) So I'm trying to write a script to check if someone is trying to do a header inject using my web
based email form. The problem is that, regardless of the content, it is being tagged as hijacked.
The following is the relevant part of my code: CODE $ip=$_POST['ip'];
$httpref=$_POST['httpref'];
$httpagent=$_POST['httpagent'];
$visitor=$_POST['visitor'];
$visitormail=$_POST['visitormail']; $s....
Phpnuke Newsletter Sending Problems
(0) i have a problem sending newsletters....when i send them no1 receives it...i tried sending to the
registered users on my site which im in and i didnt recieve it in my mail...i dont know why this is
happening...it says the newsletter is sent...but we get nothing in our mail... heres the code
QUOTE /************************************************************************/ /* PHP-NUKE:
Web Portal System */ /* ===========================
*/ /* ....
Wappymail_v1.50
wap free mail/ email admin script :-) (15) Here is my new wap mail script. You can use it as a free email sending service or an email admin
form (can set this option in config.php) its extremly simple to install and you will find full
instructions in the zip file. Please feel free to comment, rate, or update this script :-)
/tongue.gif" style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" /> ....
Regexp Function Preg_match_all()
preg_match_all() - Help me (0) Hi, I got a new problem which has caused me to go mad but no solution. preg_match_all() - is the
problem. I have something like this: CODE [ol] [li]Test1[/li]
[li]Test2[/li] [li]Test3[/li] [li]Test4[/li]
[li]Test5[/li] [/ol] Some text.Some text.Some text. [ol]
[li]Test1[/li] [ol] [li]Test1[/li]
[li]Test2[/li] [li]Test3[/li] [li]Test4[/li]
[li]Test5[/li] &....
Include File.php?id=something
using the include() function (13) Well, I am making a full CMS system for my site, and want to make the index.php file to include the
view.php?id=1 file. I tried with this code, but it didn't work: CODE <?php include
'view.php?id=1' ?> This is the error I get: CODE Warning:
main(view.php?id=1) [function.main]: failed to open stream: Invalid argument
in C:\server\xampp\htdocs\test\index.php on line 1 Warning:
main() [function.include]: Failed opening 'view.php?id=1' for inclusion
(i....
How To Use A Link To Call Function In Php?
(8) The title says it all, really. How do you call a function using in PHP? I'm doing a project
and I stumbled upon this problem. I don't want to use query string in the href part like
since that would mess up the other part of my code. Can anyone pleae help me? I've pasted the
code below. /smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /> Thanksh.
CODE <?php function display($x){ //coding goes here. } ?>
<html> <body> <p align="center"> <a href="what g....
Getting List Of Directories And Files Using Php
PHP Function for Directory and File List (6) is there a php function that lists the content of some folder.... example: /New folder new.txt
left.gif download.zip dc.exe ....so is there..? /rolleyes.gif' border='0'
style='vertical-align:middle' alt='rolleyes.gif' /> ....
Email Form
Very Simple (12) This is another little script that I devised. It's very simple. As the name suggests, it's
a script that lets the user send an email via a form. CODE SENDMAIL.PHP echo "<form
action='form-send.php' method='get'>"; echo "To: <input
type='text' name='email' size=20>"; echo "Subject: <input
type='text' name='title' size=20>"; echo "Message: <textarea
cols=50 rows=25 name='message'></textarea>"; echo "<input typ....
Looking for sending, attachments, email, function, php
|
|
Searching Video's for sending, attachments, email, function, php
|
advertisement
|
|