src/GoogleHelper/Apps/EmailHelper.php
public function setSendAsAlias($domain, $user, $name, $address, $replyTo = null, $makeDefault = false)
    {
        $url = self::BASE_URL . "{$domain}/{$user}/sendas";
        $request = <<<XML
<?xml version="1.0" encoding="utf-8"?>
<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:apps="http://schemas.google.com/apps/2006">
    <apps:property name="name" value="{$name}" />
    <apps:property name="address" value="{$address}" />
XML;
        if ($replyTo !== null) {
            $request .= "<apps:property name=\"replyTo\" value=\"{$replyTo}\" />";
        }
        if ($makeDefault) {
            $request .= "<apps:property name=\"makeDefault\" value=\"true\" />";
        }
        $request .= "</atom:entry>";
        $request = new \Google_Http_Request($url, 'POST', array('Content-Type' => 'application/atom+xml'),
           $request);

        $httpRequest = $this->helper->getClient()
           ->getAuth()
           ->authenticatedRequest($request);

        return ($httpRequest->getResponseHttpCode() == 201);
    }
public function setSendAsAlias($domain, $user, $name, $address, $replyTo = null, $makeDefault = false)
    {
        $url = self::BASE_URL . "{$domain}/{$user}/sendas";
        $request = <<<XML
<?xml version="1.0" encoding="utf-8"?>
<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:apps="http://schemas.google.com/apps/2006">
    <apps:property name="name" value="{$name}" />
    <apps:property name="address" value="{$address}" />
XML;
        if ($replyTo !== null) {
            $request .= "<apps:property name=\"replyTo\" value=\"{$replyTo}\" />";
        }
        if ($makeDefault) {
            $request .= "<apps:property name=\"makeDefault\" value=\"true\" />";
        }
        $request .= "</atom:entry>";
        $request = new \Google_Http_Request($url, 'POST', array('Content-Type' => 'application/atom+xml'),
           $request);

        $httpRequest = $this->helper->getClient()
           ->getAuth()
           ->authenticatedRequest($request);

        return ($httpRequest->getResponseHttpCode() == 201);
    }
public function setSendAsAlias ( $ domain , $ user , $ name , $ address , $ replyTo = null , $ makeDefault = false ) { $ url = self :: BASE_URL . "{$domain}/{$user}/sendas" ; $ request =  <<<XML
<?xml version="1.0" encoding="utf-8"?>
<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:apps="http://schemas.google.com/apps/2006">
    <apps:property name="name" value="{$name}" />
    <apps:property name="address" value="{$address}" />
XML ; if ( $ replyTo !== null ) { $ request .= "<apps:property name=\"replyTo\" value=\"{$replyTo}\" />" ; } if ( $ makeDefault ) { $ request .= "<apps:property name=\"makeDefault\" value=\"true\" />" ; } $ request .= "</atom:entry>" ; $ request = new \ Google_Http_Request ( $ url , 'POST' , array ( 'Content-Type' => 'application/atom+xml' ) , $ request ) ; $ httpRequest = $ this -> helper -> getClient ( ) -> getAuth ( ) -> authenticatedRequest ( $ request ) ; return ( $ httpRequest -> getResponseHttpCode ( ) == 201 ) ; }
Add a Send-as Alias
@param string $domain
@param string $user
@param string $name
@param string $address
@param string|null $replyTo
@param bool $makeDefault
@return bool Success
Add a Send - as Alias