Sets from email address only if not already set

@param email target email address
@param name  target name associated with email address
@return mail message
343084
public MailMessage defaultFrom(String email, String name) {

		if (StringUtils.isNullOrEmptyTrimmed(fromEmail)) {
			from(email, name);
		}

		if (!StringUtils.isNullOrEmptyTrimmed(email) &&
		    StringUtils.equals(fromEmail, email.trim(), true) &&
		    StringUtils.isNullOrEmptyTrimmed(fromName)) {
			from(email, name);
		}

		return this;
	}
198762
public function replyTo($emailAddress, $name = null)
    {
        $this->message->setReplyTo((string)$emailAddress, (string)$name);
        return $this;
    }
769705
public function setReplyTo($email, $name = null)
    {
        if ($email instanceof ReplyTo) {
            $this->reply_to = $email;
        } else {
            $this->reply_to = new ReplyTo($email, $name);
        }
    }
719645
public function cc(string $email, ?string $name = null)
  {
    $this->cc[] = ['email' => $email, 'name' => $name];
    return $this;
  }
596991
public ArrayList<Long> delegatedAccount_email_filter_name_rule_GET(String email, String name) throws IOException {
		String qPath = "/email/domain/delegatedAccount/{email}/filter/{name}/rule";
		StringBuilder sb = path(qPath, email, name);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, t3);
	}
1238305
public static boolean isValidEmailAddress(final String email) {
    if (email == null) {
      return false;
    }

    boolean result = true;
    try {
      final InternetAddress emailAddr = new InternetAddress(email);
      emailAddr.validate();
    } catch (final AddressException ex) {
      result = false;
    }
    return result;
  }
638123
function setSender( $email, $name = false )
    {
        $this->Mail->from = new ezcMailAddress( $email, $name, $this->usedCharset() );
        $this->From = array( 'name' => $name,
                             'email' => $email );
    }
117426
public String generateAntiSpamMailto(String name, String email)
    {
        StringTokenizer st = new StringTokenizer(email, "@");
        if (Security.containsXssRiskyCharacters(email) || st.countTokens() != 2)
        {
            throw new IllegalArgumentException("Invalid email address: " + email);
        }

        String before = st.nextToken();
        String after = st.nextToken();

        StringBuffer buffer = new StringBuffer();

        buffer.append("Contact ");
        buffer.append(Security.replaceXmlCharacters(name));
        buffer.append(" using: <span id=\"asmgLink\"></span>\n");
        buffer.append("<script type='text/javascript'>\n");

        buffer.append("var before = '");
        buffer.append(before);
        buffer.append("';\n");

        buffer.append("var after = '");
        buffer.append(after);
        buffer.append("';\n");

        buffer.append("var link = \"<a href='mail\" + \"to:\" + before + '@' + after + \"'>\" + before + '@' + after + \"</a>\";\n");

        buffer.append("document.getElementById(\"asmgLink\").innerHTML = link;\n");
        buffer.append("</script>\n");
        buffer.append("<noscript>[");
        buffer.append(before);
        buffer.append(" at ");
        buffer.append(after);
        buffer.append("]</noscript>\n");

        return buffer.toString();
    }
946691
public function sender($email, $name = null)
    {
        $email = $this->normalizeEmail($email);
        $this->getSwiftMessage()->setSender($email, $name);

        return $this;
    }
1221624
public function setFrom($email, $name = null)
    {
        return parent::setFrom(
            $this->parseDomainPlaceholderAsPiwikHostName($email),
            $name
        );
    }
196353
public function cc($email, $name = '')
    {
        if (empty($email)) {
            throw new MailerException('email is required for cc!');
        }

        $this->_mailer->addCC($email, $name);

        return $this;
    }
1356957
public function from($email, $name = false)
	{
		$this->config['from']['email'] = (string) $email;
		$this->config['from']['name']  = (is_string($name)) ? $name : false;

		if ($this->config['encode_headers'] and $this->config['from']['name'])
		{
			$this->config['from']['name'] = $this->encode_mimeheader((string) $this->config['from']['name']);
		}

		return $this;
	}
1145970
public function setFrom(string $email, string $name = null): self
    {
        $this->setHeader('From', $this->formatEmail($email, $name));

        return $this;
    }
1198120
@NonNull
    public EmailIntentBuilder cc(@NonNull String cc) {
        checkEmail(cc);
        this.cc.add(cc);
        return this;
    }
248227
private function formatEmail($email, $name = null)
    {
        /**
         * Organization of the list of senders
         */
        if (!is_string($name) && preg_match('/^(.+)\s+<(.*)>\z$/', $email, $matches)) {
            array_shift($matches);
            $name = $matches[0];
            $email = $matches[1];
        }

        if (!Str::isMail($email)) {
            throw new \InvalidArgumentException("$email is not valid email.", E_USER_ERROR);
        }

        return [$name, $email];
    }
924918
public function to($mail, $name = null)
    {
        $this->message->addTo($mail, $name);
        return $this;
    }
127147
public function addTo(string $email, string $name = null): self
	{
		$this->message->addTo($email, $name);
		$this->recipients[] = $email;
		return $this;
	}