Sets an Header Field by Name and Value.
@access		public
@param		string		$name			Header Field Name
@param		string		$value			Header Field Value
@param		boolean		$emptyBefore	Flag: TRUE - set | FALSE - append
@return		void
978135
public function setFieldPair( $name, $value, $emptyBefore = TRUE )
	{
		return $this->setField( new Net_Mail_Header_Field( $name, $value ), $emptyBefore );
	}
130292
public function set($name, $value)
    {
        $target = &$this->get($name);
        if ((!is_array($value) && $target instanceof Field\FormField) || $target instanceof Field\ChoiceFormField) {
            $target->setValue($value);
        } elseif (is_array($value)) {
            $fields = self::create($name, $value);
            foreach ($fields->all() as $k => $v) {
                $this->set($k, $v);
            }
        } else {
            throw new \InvalidArgumentException(sprintf('Cannot set value on a compound field "%s".', $name));
        }
    }
448445
public function setAttribute($name, $value = null)
    {
        if (is_array($name)) {
            foreach ($name as $k => $v) {
                $this->attributes[$k] = $v;
            }
        } else {
            $this->attributes[$name] = $value;
        }
    }
1296729
public function setHeader($name, $value)
    {
        if (isset($this->headers[$name])) {
            if (is_array($this->headers[$name])) {
                $this->headers[$name] = (array)$value;
            } else {
                $this->headers[$name] = $value;
            }
        } else {
            $this->headers[$name] = (array)$value;
        }

        return $this;
    }
495130
public function addDefaultHeader($name, $value)
    {
        if (!isset($this->headers[$name])) {
            $this->headers[$name] = $value;
        }

        return $this;
    }
1023960
protected function setHeader($name, $value)
    {
        if (! is_array($value)) {
            $value = [$value];
        }
        $this->headers[$name] = $value;
        $this->headerKeys[strtolower($name)] = $name;
    }
1043833
public function set($name, $value)
    {
        $name = strtolower($name);

        if (isset($this->obj_headers[$name])) {
            $this->{$this->obj_headers[$name]} = $value;
        }
        else {
            $this->others[$name] = $value;
        }
    }
960657
public function addHeader($name, $value = null) {
        if ($this->canSetHeaders()) {
            if ($value === null) {
                $value = trim(substr($name, strpos($name, ':') + 1));
                $name = trim(substr($name, 0, strpos($name, ':')));
            }

            $this->headers[$name] = $value;
        }
    }
229805
private function setHeader($name, $value = null, $httpResponseCode = null)
    {
        header($name . ($value ? ': ' . $value : ''), true, $httpResponseCode);
    }
743209
public function addFieldPair( $name, $value )
	{
		$field	= new Net_Mail_Header_Field( $name, $value );
		$this->addField( $field );
	}
1007949
public function set($name, $value)
    {
        if (property_exists($this, $name)) {
            $this->$name = $value;

            return true;
        }

        return null;
    }
1283324
public function addTextHeader($name, $value = null)
    {
        $this->storeHeader($name, $this->factory->createTextHeader($name, $value));
    }
1287238
public function dontSeeHttpHeader($name, $value = null)
    {
        if ($value !== null) {
            $this->assertNotEquals(
                $value,
                $this->getRunningClient()->getInternalResponse()->getHeader($name)
            );
            return;
        }
        $this->assertNull($this->getRunningClient()->getInternalResponse()->getHeader($name));
    }
1186357
public function set($name, $value)
    {
        if ($this->readonly) {
            throw new ReadonlyException();
        }

        $this->headers[$name] = $value;
    }
1110139
public function setHeader(string $name, $value, bool $append = false)
    {
        if (!$name || \preg_match('#[^a-z0-9-]#i', $name)) {
            throw new InvalidArgumentException("Header name must be non-empty alphanumeric string, '$name' given.");
        }

        if ($value == null) { // intentionally ==
            if (!$append) {
                unset($this->headers[$name]);
            }

        } elseif (\is_array($value)) { // email
            $tmp = &$this->headers[$name];
            if (!$append || !\is_array($tmp)) {
                $tmp = [];
            }

            foreach ($value as $email => $recipient) {
                if ($recipient === null) {
                    // continue
                } elseif (!Strings::checkEncoding($recipient)) {
                    if (!\preg_match('##u', $recipient)) {
                        throw new InvalidArgumentException('Name is not valid unicode string.');
                    }
                } elseif (\preg_match('#[\r\n]#', $recipient)) {
                    throw new InvalidArgumentException('Name must not contain line separator.');
                }

                if (!\filter_var($email, \FILTER_VALIDATE_EMAIL)) {
                    throw new InvalidArgumentException('Name must match the email structure.');
                }

                $tmp[$email] = $recipient;
            }

        } else {
            $value = (string) $value;
            if (!Strings::checkEncoding($value)) {
                throw new InvalidArgumentException('Header is not valid UTF-8 string.');
            }
            $this->headers[$name] = \preg_replace('#[\r\n]+#', ' ', $value);
        }

        return $this;
    }
1374889
public void set(String name, String value) {
		HttpHeader header = get(name);
		if(header == null) {
			add(name,value);
		} else {
			header.setValue(value);
		}
	}
780094
public function add(string $name, string $value): void
    {
        $key = strtolower($name);
        if (!isset($this->headers[$key])) {
            $this->headers[$key] = [$name, $value];

            return;
        }

        $this->headers[$key] = [$name, $this->headers[$key][1] . ', ' . $value];
    }