Generate a 'mailto' URL to share this content via Email.

@return string|false
174342
public function EmailShareLink()
    {
        if (!$this->owner->hasMethod('AbsoluteLink')) {
            return false;
        }
        $pageURL = $this->owner->AbsoluteLink();
        $subject = rawurlencode(_t('JonoM\ShareCare\ShareCare.EmailSubject', 'Thought you might like this'));
        $body = rawurlencode(_t('JonoM\ShareCare\ShareCare.EmailBody', 'Thought of you when I found this: {URL}', array('URL' => $pageURL)));

        return ($pageURL) ? "mailto:?subject=$subject&body=$body" : false;
    }
504374
protected function sendActivationEmail()
    {
        $forum = Podium::getInstance()->podiumConfig->get('name');
        $email = Content::fill(Content::EMAIL_REGISTRATION);
        if ($email !== false) {
            $link = Url::to(['account/activate', 'token' => $this->activation_token], true);
            return Email::queue(
                $this->email,
                str_replace('{forum}', $forum, $email->topic),
                str_replace('{forum}', $forum, str_replace('{link}',
                    Html::a($link, $link), $email->content)),
                !empty($this->id) ? $this->id : null
            );
        }
        return false;
    }
1037443
public function send()
    {
        $to      = $this->getHeaderLine('to');
        $subject = $this->subject;
        $message = $this->message;

        return mail($to, $subject, $message, $this->parseHeaders());
    }
1181930
public function toString()
    {
        $email = '<' . Mime::encodeEmail($this->email()) . '>';
        $name = $this->name();
        return $name ? Mime::encodeValue($name) . ' ' . $email : $email;
    }
743311
public function mailto($email, $title = null, $attributes = [])
    {
        $email = $this->email($email);

        $title = $title ?: $email;

        $email = $this->obfuscate('mailto:') . $email;

        return '<a href="' . $email . '"' . $this->attributes($attributes) . '>' . $this->entities($title) . '</a>';
    }
224854
public function getSMTPObject()
    {
        if ($this->_smtp) {
            return $this->_smtp;
        }

        $this->_smtp = new Net_SMTP(
            $this->_params['host'],
            $this->_params['port'],
            $this->_params['localhost']
        );

        /* Set pipelining. */
        if ($this->_params['pipelining']) {
            $this->_smtp->pipelining = true;
        }

        /* If we still don't have an SMTP object at this point, fail. */
        if (!($this->_smtp instanceof Net_SMTP)) {
            throw new Horde_Mail_Exception('Failed to create a Net_SMTP object', self::ERROR_CREATE);
        }

        /* Configure the SMTP connection. */
        if ($this->_params['debug']) {
            $this->_smtp->setDebug(true);
        }

        /* Attempt to connect to the configured SMTP server. */
        $res = $this->_smtp->connect($this->_params['timeout']);
        if ($res instanceof PEAR_Error) {
            $this->_error('Failed to connect to ' . $this->_params['host'] . ':' . $this->_params['port'], $res, self::ERROR_CONNECT);
        }

        /* Attempt to authenticate if authentication has been enabled. */
        if ($this->_params['auth']) {
            $method = is_string($this->_params['auth'])
                ? $this->_params['auth']
                : '';

            $res = $this->_smtp->auth($this->_params['username'], $this->_params['password'], $method);
            if ($res instanceof PEAR_Error) {
                $this->_error("$method authentication failure", $res, self::ERROR_AUTH);
            }
        }

        return $this->_smtp;
    }
287342
public function sendEmailVerification() {
    if (!isset($this->guid)) {
      return false;
    }
    $success = true;
    if (isset($this->secret) && !isset($this->cancelEmailSecret)) {
      // phpcs:ignore Generic.Files.LineLength.TooLong
      $link = htmlspecialchars(Tilmeld::$config['setup_url'].(strpos(Tilmeld::$config['setup_url'], '?') ? '&' : '?').'action=verifyemail&id='.$this->guid.'&secret='.$this->secret);
      $macros = [
        'verify_link' => $link,
        'to_phone' => htmlspecialchars(
            \uMailPHP\Mail::formatPhone($this->phone)
        ),
        'to_timezone' => htmlspecialchars($this->timezone),
        'to_address' =>
          $this->addressType == 'us'
            ?
              htmlspecialchars(
                  "{$this->addressStreet} {$this->addressStreet2}"
              ).'<br />'.
              htmlspecialchars(
                  "{$this->addressCity}, {$this->addressState} ".
                    "{$this->addressZip}"
              )
            : '<pre>'.htmlspecialchars($this->addressInternational).'</pre>'
      ];
      $mail = new \uMailPHP\Mail(
          '\Tilmeld\Entities\Mail\VerifyEmail',
          $this,
          $macros
      );
      $success = $success && $mail->send();
    }
    if (isset($this->secret) && isset($this->cancelEmailSecret)) {
      // phpcs:ignore Generic.Files.LineLength.TooLong
      $link = htmlspecialchars(Tilmeld::$config['setup_url'].(strpos(Tilmeld::$config['setup_url'], '?') ? '&' : '?').'action=verifyemailchange&id='.$this->guid.'&secret='.$this->secret);
      $macros = [
        'verify_link' => $link,
        'old_email' => htmlspecialchars($this->cancelEmailAddress),
        'new_email' => htmlspecialchars($this->email),
        'to_phone' => htmlspecialchars(
            \uMailPHP\Mail::formatPhone($this->phone)
        ),
        'to_timezone' => htmlspecialchars($this->timezone),
        'to_address' =>
          $this->addressType == 'us'
            ?
              htmlspecialchars(
                  "{$this->addressStreet} {$this->addressStreet2}"
              ).'<br />'.
              htmlspecialchars(
                  "{$this->addressCity}, {$this->addressState} ".
                    "{$this->addressZip}"
              )
            : '<pre>'.htmlspecialchars($this->addressInternational).'</pre>'
      ];
      $mail = new \uMailPHP\Mail(
          '\Tilmeld\Entities\Mail\VerifyEmailChange',
          $this,
          $macros
      );
      $success = $success && $mail->send();
    }
    if (isset($this->cancelEmailSecret)) {
      // phpcs:ignore Generic.Files.LineLength.TooLong
      $link = htmlspecialchars(Tilmeld::$config['setup_url'].(strpos(Tilmeld::$config['setup_url'], '?') ? '&' : '?').'action=cancelemailchange&id='.$this->guid.'&secret='.$this->cancelEmailSecret);
      $macros = [
        'cancel_link' => $link,
        'old_email' => htmlspecialchars($this->cancelEmailAddress),
        'new_email' => htmlspecialchars($this->email),
        'to_phone' => htmlspecialchars(
            \uMailPHP\Mail::formatPhone($this->phone)
        ),
        'to_timezone' => htmlspecialchars($this->timezone),
        'to_address' =>
          $this->addressType == 'us'
            ?
              htmlspecialchars(
                  "{$this->addressStreet} {$this->addressStreet2}"
              ).'<br />'.
              htmlspecialchars(
                  "{$this->addressCity}, {$this->addressState} ".
                    "{$this->addressZip}"
              )
            : '<pre>'.htmlspecialchars($this->addressInternational).'</pre>'
      ];
      $mail = new \uMailPHP\Mail(
          '\Tilmeld\Entities\Mail\CancelEmailChange',
          $this,
          $macros
      );
      $success = $success && $mail->send();
    }
    return $success;
  }
1023750
public function getUrl()
    {
        if (!$this['linkTo'] || !isset($this['linkTo']['type'])) {
            $this['linkTo'] = $this->createLinkTo();
        }

        return $this->linkTo->getUrl($this['linkTo']);
    }
549734
public function getLinkURL()
    {
        if (!$this->ID) {
            return '';
        }

        $type = $this->Type;
        switch ($type) {
            case 'URL':
                $LinkURL = $this->URL;
                break;
            case 'Email':
                $LinkURL = $this->Email ? "mailto:$this->Email" : null;
                break;
            case 'Phone':
                $LinkURL = $this->Phone ? "tel:$this->Phone" : null;
                break;
            default:
                if ($this->getTypeHasDbField()) {
                    $LinkURL = $this->{$type};
                } else {
                    if ($type && $component = $this->getComponent($type)) {
                        if (!$component->exists()) {
                            $LinkURL = false;
                        } elseif ($component->hasMethod('Link')) {
                            $LinkURL = $component->Link() . $this->Anchor;
                        } else {
                            $LinkURL = "Please implement a Link() method on your dataobject \"$type\"";
                        }
                    }
                }
                break;
        }

        $this->extend('updateLinkURL', $LinkURL);

        return $LinkURL;
    }
1193385
static public function scrambleEmail($email, $mailTo = false) {
        for ($i = 0, $c = strlen($email), $out = ''; $i < $c; $i++) {
            $out .= '&#' . ord($email[$i]) . ';';
        }
        if ($mailTo) {
            $out = self::scrambleEmail('mailto:') . $out;
        }
        return $out;
    }
942990
protected function _getTransport()
    {
        if ($this->_mailer === 'smtp') {
            $transport = Swift_SmtpTransport::newInstance($this->_site_settings->smtphost, $this->_site_settings->smtpport)
            ->setUsername($this->_site_settings->smtpuser)
            ->setPassword($this->_site_settings->smtppass);
        } elseif ($this->_mailer === 'sendmail') {
            $transport = Swift_SendmailTransport::newInstance('/usr/sbin/exim -bs');
        } else {
            $transport = Swift_MailTransport::newInstance();
        }

        return $transport;
    }
754881
public function getUrl( $email ){
		$hash	= md5( strtolower( trim( $email ) ) );
		$query	= array(
			's'	=> $this->size,
			'd'	=> $this->default,
			'r'	=> $this->rate,
		);
		return $this->url.$hash.'?'.http_build_query( $query, NULL, '&amp;' );
	}
894386
private function formatTo() {

		$to = null;

		if(true === isset($this -> headers['to'])) {
			$to = $this -> emailsToString($this -> headers['to']);
		}

		return $to;
	}
550892
public function canShowUrl()
    {
        return (boolean)$this->quote->getStore()->getWebsite()->getConfig(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_CONTENT_LINK_ENABLED
        );
    }
220556
private function generateUrl(): string
    {
        static $re = '/\%5B\d+\%5D/m';
        static $subst = '%5B%5D';

        $query = [];
        /**
         * @var IArgument
         */
        foreach ($this->arguments as $key => $value) {
            $query[$key] = $value->toPrimitive();
        }

        foreach ($this->mergeableArguments as $key => $value) {
            $query[$key] = $value->toPrimitive();
        }

        foreach ($this->stackableArguments as $key => $value) {
            $query[$key] = $value->toArray();
        }

        $queryArg = http_build_query($query, null, '&', PHP_QUERY_RFC3986);

        $fullUrl = $this->routeUrl() . '?' . preg_replace($re, $subst, $queryArg);

        return $fullUrl;
    }
544683
protected function buildEmailString()
    {
        $email = $this->prefix.$this->email;

        if (isset($this->subject) || isset($this->body)) {
            $data = [
                'subject' => $this->subject,
                'body'    => $this->body,
            ];
            $email .= '?'.http_build_query($data);
        }

        return $email;
    }
1342000
public function getAlternateUriSet()
    {
        $uris = [];
        if (isset($this->principalProperties['{DAV:}alternate-URI-set'])) {
            $uris = $this->principalProperties['{DAV:}alternate-URI-set'];
        }

        if (isset($this->principalProperties['{http://sabredav.org/ns}email-address'])) {
            $uris[] = 'mailto:'.$this->principalProperties['{http://sabredav.org/ns}email-address'];
        }

        return array_unique($uris);
    }