0

Trying to do this with HTML/CSS and hopefully not JS unless it’s necessary. Currently trying.

<a class=“button” href=“mailto:blah@blah.com”>blah</a>
Ratan Uday Kumar
  • 5,738
  • 6
  • 35
  • 54
Sean's e
  • 1
  • 4
  • 1
    What are you trying to do, what exactly you want to achieve, please tell briefly! You want to send an email? or on what you are stuck you should've shared that as well – nazifa rashid Jul 23 '19 at 03:41
  • 1
    You definitely can't do that with just CSS ... – Gosi Jul 23 '19 at 03:44
  • 1
    @user46812 this looks like it is already answered at https://stackoverflow.com/questions/4782068/can-i-set-subject-content-of-email-using-mailto – Stuart Dines Jul 23 '19 at 03:45
  • @StuartDines doesn’t specify using a button so I’m not sure how this answers my question. – Sean's e Jul 23 '19 at 03:48
  • @Gosi so I need JS like now huh? – Sean's e Jul 23 '19 at 03:49
  • @nazifarashid im trying to make a button that will open your email client and compose a new email to my address – Sean's e Jul 23 '19 at 03:50
  • @StuartDines referenced a link containing the correct solution. You need an anchor tag; not a button, to accomplish this. How you style it is entirely up to you but anchor is the correct element. – Nathan Dawson Jul 23 '19 at 03:51
  • You can't use javascript to send email, you need a server side language like PHP. There, you can set your reply to address. – Gosi Jul 23 '19 at 03:52
  • 1
    @user46812 https://css-tricks.com/snippets/html/mailto-links/ Check if this link helps you. – nazifa rashid Jul 23 '19 at 03:54
  • Currently I get an unsupported url message, which could be coming from the text editor I’m using to deploy the site. – Sean's e Jul 23 '19 at 04:17
  • Your code specifies an `a` tag. What, precisely is the problem and why is it not a duplicate of : https://stackoverflow.com/questions/4782068/can-i-set-subject-content-of-email-using-mailto ? – Jon P Jul 23 '19 at 05:59
  • 2
    Also watch out for "curly quotes" .... e.g. : “ & ” , which you have in your code, you want regular quotes e.g. :`blah` , with that typo fixed, your code works: https://jsfiddle.net/ – Jon P Jul 23 '19 at 06:06
  • @JonP you should post that as an answer. It is correct and works. – Gosi Jul 23 '19 at 06:11
  • @Gosi , it's also just a typographical error, which is actually off topic. – Jon P Jul 23 '19 at 06:16

0 Answers0