# How to use hyperref mailto: together with new command

Background:

So basically, I would like to have a hyperlink to an email address. That email address, however, should not be fixed at the moment. It should be changeable.

So I tried to achieve that by defining the email as a new command, and then use it inside hyperref command.

But it doesn't seem to work. Latex gave me an error: undefined control sequence.

\documentclass{article}
\usepackage{hyperref}
\begin{document}

\end{document}


Any help is greatly appreciated.

• By the way, for the MWE you can leave out the lines which import graphicx, tikz, etc. and even the hypersetup line, because they are not necessary to get the issue across. Jun 16, 2021 at 9:12
• Sorry, I will amend it shortly Jun 16, 2021 at 10:12

\documentclass{article}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{tikz}