def smtp_config_writer_kwargs(kwargs, config, key):
    """
    Set server/port/username/password config.

    :param kwargs: Values. Refer to `:func:smtp_config_writer`.
    :type kwargs: dict

    :param config: Configuration dictionary.
    :type config: dict

    :param key: Key for kwargs and config dict.
    :type key: str
    """
    if kwargs[key] is not None:
        config[key] = kwargs[key]
    return kwargs
