You can get the original attachment filename via wp_get_attachment_url
:
echo basename( wp_get_attachment_url( $post->ID ) );
or in the form of the example you provided:
<a href="https://wordpress.stackexchange.com/questions/91547/mailto:[email protected]?Subject=Image: <?php the_title(); ?> - <?php echo basename( wp_get_attachment_url( $post->ID ) ); ?>">Get in touch about this image</a>
Related Posts:
- How to create a CSV on the fly and send as an attachment using wp_mail?
- Post Via Email – How to send Attachments with it (e.g. PDF File or JPEG Image)?
- wp_mail not sending attachment
- Auto create file and send it via wp_mail()
- Attach pdf from dynamic url
- Attach a external file as attachement using wp_mail
- wp_mail attachment not working in wordpress
- How To Retrieve An Image Attachment’s Alt Text?
- How to manage attachment relationships for specific posts in WP 3.5+
- Change attachment filename
- Getting a taxonomy’s thumbnail url
- Check if post has attachments (not image)
- How to cleanly delete attachment but retain original file?
- Expanding new Media Uploader in WordPress 3.5
- Applying automatic link class to images embedded to posts
- How to get attachment caption (get_the_excerpt gives parent post excerpt) ?
- How to single click to download image in single post
- delete attachment from front end
- custom fields for attachments?
- URL rewrite with add_rewrite_rule and attachment_id
- How to set author for post AND post attachments
- Get attachment from post
- How can I display custom fields value from attachment media?
- Add column for attachment file size
- Change image link: wp_get_attachment_link
- Multi-line captions on attachments
- Gel all image from certain post type
- Making images from single.php pointing to an attachment .php template
- Add_Filter example for wp_get_attachment_link
- ID of images from gallery
- wp_get_attachment_image_src always returns false
- Exact image sizes
- Get the size (size in Kb or MB) of an featured image?
- Automatically delete attachments and posts [closed]
- Get attachment file link
- How to grab the first two image attachments from a post?
- wp_insert_post featured image from library
- How to delete orphan attachments?
- the_content() behavior on attachment.php versus single.php
- Get the title and URL of the attachment parent post
- Confused with attachment mimetype order
- Disable edit media attachments?
- Getting ID from ajax response of async-upload.php
- Post Auto Draft Issue
- How to make a customized “Create Gallery” tab in the ‘Add Media’ window?
- rename attachments based on parent-post-title on upload
- Rename attachments during upload no matter what filetype
- Link all WordPress images size
- post_author for wp_insert_attachment
- Displaying Post Attachment(s) at Top of single.php
- Ordering of gallery images without using shortcode in theme
- Adding width and height to wp_get_attachment_image_src
- Get the bare URL for an attachment
- Don’t show attachments if they are inserted in post
- Control attachments menu order with jQuery Sortable
- How to delete a custom file from upload directory when deleting its post
- Media library quick/inline edit
- Email Attachment from Form Submit
- Check what attached image size is used
- Custom image sizes add to metadata
- What is the best way to store thumbnails for a non-image attachment?
- How do you create an attachment ID with Ajax submit? No page refresh
- What will happen if I delete all my attachment type posts from database?
- hide attached images of a post
- How to get $attachment->ID in custom functions
- All attachment pages give 404
- Unable to get wp_get_attachment_url to show
- Get Attachment Image Class by attachment id
- has_excerpt yields true but no post_excerpt when retrieved
- Automatically deactivate link for attachments
- Hiding or removing file extension displayed in HTML on attachment page
- After changing permalink structure, How to redirect attachment url to old parent post url
- Can’t sort get_posts by post_mime_type
- Getting attachment post using wp_get_attachment_link
- How to list “invisible” Auto Drafts?
- How to add media from front-end to an existing post and edit file title
- wp_mail Allow Remote Attachments from CDN
- Were attachment media settings removed from WordPress?
- How to identify and delete all the images/pdf’s which are not assigned to any post/custom-post/page and also which are repeated
- Filter not applied to all image sizes
- Zip a file and add as attachment
- Nothing found in uploads folder after wp_insert_attachment
- Remove post with attachments hook
- Setting an image as post header (not featured image)
- PHPMailer – Uploading a file
- How to restrict users to only access their own media files in wordpress
- wp_mail doen’t send mails whit attachment
- When inserting attachments into a blog post, how can I get WordPress to use the full filename with the extension?
- List attachments of a page
- Importing Attachments with No Extension
- Is there a way to add Reattach and Unattach links in image gallery?
- Post images not displaying as attachments
- How to retrieve images contained in a post
- Showing the attachment for a page?
- How can we select attachements based on Caption?
- Gallery Thumbnail Layout Template
- Calling a javascript function in post edit page after attaching something to post
- Custom Fields, Media uploader, Attachments
- No attachments on contact form 7
- Change the next thumbnail to text