/    Sign up×
Community /Pin to ProfileBookmark

Sending images as email attachments via a form?

Hello all,

I am having a bit of trouble. I want to allow users to send me an attachment through a form.

The page it is on has a “submit” button at the bottom, which sends the entire page entries to my email address. However, when I recieve this email, all it says is the location of the file on the user’s harddrive. It does not attach the picture to the email.

Here is the code I am currently using to try to accompish this:

<form method=”POST” action=”mailto: (my email address)” enctype=”multipart/form-data”>
Attachment: <input type=”file” name=”attachedfile” allow=”image/*”>

Any help would be greatly appreciated!

to post a comment
Full-stack Developer

4 Comments(s)

Copy linkTweet thisAlerts:
@ray326May 24.2005 — You can't use mailto: for that. You have to parse the multipart data, save the file then build your email from scratch on the server.
Copy linkTweet thisAlerts:
@LDWPauthorMay 24.2005 — Thank you very much. Do you by chance happen to know of any websites where I could find some codes on how to do that?
Copy linkTweet thisAlerts:
@FangMay 24.2005 — [URL=http://www.sitepoint.com/article/advanced-email-php]Advanced email in PHP[/URL]
Copy linkTweet thisAlerts:
@LDWPauthorMay 24.2005 — Thanks very very much! ?
×

Success!

Help @LDWP spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...