For fun, here is a more "intelligent" solution that can automatically change the behavior based on the number of authors added.
\documentclass[final,times,letterpaper,authoryear,12pt]{elsarticle}
\usepackage{etoolbox}
\makeatletter
%1. Define counter
\newcounter{numberofauthors}
%2. Modify \emailauthor and \urlauthor
\pretocmd{\emailauthor}{\ifnum\value{numberofauthors}>1}{}{}
\apptocmd{\emailauthor}{\else\stepcounter{ead}\g@addto@macro\@elseads{\raggedright\let\corref\@gobble\eadsep\texttt{#1}\def\eadsep{\unskip,\space}}\fi}{}{}
\pretocmd{\urlauthor}{\ifnum\value{numberofauthors}>1}{}{}
\apptocmd{\urlauthor}{\else\g@addto@macro\@elsuads{\let\corref\@gobble\raggedright\eadsep\texttt{#1}\def\eadsep{\unskip,\space}}\fi}{}{}
%3. Modify \author
\pretocmd{\author}{\addtocounter{numberofauthors}{1}}{}{}
%4. Modify frontmatter
\AtBeginEnvironment{frontmatter}{\makeatletter\immediate\write\@auxout{\string\setcounter{numberofauthors}{\expandafter\@arabic\thenumberofauthors}}\makeatother\setcounter{numberofauthors}{0}}
\AtEndEnvironment{frontmatter}{\makeatletter\immediate\write\@auxout{\string\setcounter{numberofauthors}{\expandafter\@arabic\thenumberofauthors}}\makeatother}
\makeatother
\begin{document}
\begin{frontmatter}
\title{Sample title
\tnoteref{t1}}
\tnotetext[t1]{Preliminary and incomplete.}
\author{John Doe\fnref{fn1}}
\address{Bogus Department, Bogus University}
\fntext[fn1]{Contact: Bogus University, Bogus Department, 23 Grey Street, 3rd floor Fake City, USA.}
\ead{doe@gmail.com}
\ead[url]{https://johndoe.com/}
\author{Jane Doe}
\address{Another Bogus Department, Another Bogus University}
\fntext[fn1]{Contact: Another Bogus University, Another Bogus Department, 23 Grey Street, 3rd floor Fake City, USA.}
\ead{janedoe@gmail.com}
\ead[url]{https://janedoe.com/}
\begin{abstract}
Sample abstract
\end{abstract}
\end{frontmatter}
\end{document}
Which yields:

If the entries related to Jane Doe are removed, the following is produced:

Explanation:
The elsarticle class writes the \emailauthor and urlauthor commands to the aux file, which is then read in at the beginning of the document and these commands are executed, defining the @elseads and @elsuads macros to contain the email addresses and urls of the authors, respectively. With some surgery on elsarticle.cls, we can redefine \emailauthor and \urlauthor to exclude the name of the author if there is only one. These commands evaluate the number of authors courtesy of a new counter numberofauthors, the value of which is written before the \emailauthor and \urlauthor commands in the aux file.
Step 1: Add the numberofauthors counter.
elsarticle.cls defines an author counter, but its does not appear to be used as expected. Also, it is better to avoid conflicts by defining a new one.
\newcounter{numberofauthors}
Step 2: Make \emailauthor and \urlauthor dependent on numberofauthors.
This is accomplished by adding this to the preamble:
\pretocmd{\emailauthor}{\ifnum\value{numberofauthors}>1}{}{}
\apptocmd{\emailauthor}{\else\stepcounter{ead}\g@addto@macro\@elseads{\raggedright\let\corref\@gobble\eadsep\texttt{#1}\def\eadsep{\unskip,\space}}\fi}{}{}
\pretocmd{\urlauthor}{\ifnum\value{numberofauthors}>1}{}{}
\apptocmd{\urlauthor}{\else\g@addto@macro\@elsuads{\let\corref\@gobble\raggedright\eadsep\texttt{#1}\def\eadsep{\unskip,\space}}\fi}{}{}
The \pretocmd{\emailauthor} and \apptocmd{\emailauthor} calls change the definition of \emailauthor from
\gdef\emailauthor#1#2{\stepcounter{ead}%
\g@addto@macro\@elseads{\raggedright%
\let\corref\@gobble
\eadsep\texttt{#1} (#2)\def\eadsep{\unskip,\space}}%
}
to (*formatted here for readability):
\def\emailauthor#1#2{
\ifnum\value{numberofauthors}>1
\stepcounter{ead}%
\g@addto@macro\@elseads{\raggedright%
\let\corref\@gobble
\eadsep\texttt{#1} (#2)\def\eadsep{\unskip,\space}}%
\else
\stepcounter{ead}%
\g@addto@macro\@elseads{\raggedright%
\let\corref\@gobble
\eadsep\texttt{#1}\def\eadsep{\unskip,\space}}%
\fi}%
\pretocmd{\urlauthor} and \apptocmd{\urlauthor} similarly change the definition of \urlauthor.
Step 3: Increment numberofauthors whenever \author is called.
This is accomplished by:
\pretocmd{\author}{\addtocounter{numberofauthors}{1}}{}{}
Which redefines \author from
\def\author{\@ifnextchar[{\@@author}{\@author}}
to
\def\author{\addtocounter{numberofauthors}{1}\@ifnextchar[{\@@author}{\@author}}
Step4: Preserve the numberofauthors in the aux file.
This is accomplished by
\AtBeginEnvironment{frontmatter}{\makeatletter\immediate\write\@auxout{\string\setcounter{numberofauthors}{\expandafter\@arabic\thenumberofauthors}}\makeatother\setcounter{numberofauthors}{0}}
\AtEndEnvironment{frontmatter}{\makeatletter\immediate\write\@auxout{\string\setcounter{numberofauthors}{\expandafter\@arabic\thenumberofauthors}}\makeatother}
which is the same as:
\begin{frontmatter}
\makeatletter
\immediate\write\@auxout{\string\setcounter{numberofauthors}{\expandafter\@arabic\thenumberofauthors}}
\makeatother
\setcounter{numberofauthors}{0}
%Normal title and author definitions
\makeatletter
\immediate\write\@auxout{\string\setcounter{numberofauthors}{\expandafter\@arabic\thenumberofauthors}}
\makeatother
\end{frontmatter}
Behavior of the \setcounter pair is best explained by showing relevant portions of the aux file after each run:
First run (no previous aux file):
\setcounter{numberofauthors}{0}
\emailauthor{doe@gmail.com}{John Doe\fnref {fn1}}
\urlauthor{https://johndoe.com/}{John Doe\fnref {fn1}}
\setcounter{numberofauthors}{1}
On the second run, the numberofauthors counter is 0 when \emailauthor and \urlauthor are evaluated, yielding email addresses and urls without authors. Following the second run (using the above aux file) the aux file contains:
\setcounter{numberofauthors}{1}
\emailauthor{doe@gmail.com}{John Doe\fnref {fn1}}
\urlauthor{https://johndoe.com/}{John Doe\fnref {fn1}}
\setcounter{numberofauthors}{1}
This remains the same in subsequent runs, resulting in the desired behavior for \emailauthor and \urlauthor.