Send supplied enquiry to contact email

 @param enquiry [Enquiry] enquiry which the visitor has created
424617
def forward_enquiry(enquiry)
      @enquiry = enquiry
      sender = email_sender(enquiry.name, enquiry.email)

      mail subject: forwarding_subject(enquiry), from: sender, to: incoming_email_address, reply_to: sender
    end
424200
def send_form_email(params, subject)
        body = []
        params.each_pair { |k,v| body << "#{k}: #{v}"  }
        BasicMailer.mail(:subject => subject, :body => body.join("\n")).deliver
      end
1031587
def send_invite    
      return if self.email.blank?
      
      application = self.applicant_answer_sheet
      
      Notifier.deliver_notification(self.email,
                                    application.email, 
                                    "Reference Invite", 
                                    {'reference_full_name' => self.name, 
                                     'applicant_full_name' => application.name,
                                     'applicant_email' => application.email, 
                                     'applicant_home_phone' => application.phone, 
                                     'reference_url' => edit_reference_sheet_url(self, :a => self.access_key, :host => ActionMailer::Base.default_url_options[:host])})
      # Send notification to applicant
      Notifier.deliver_notification(applicant_answer_sheet.email, # RECIPIENTS
                                    Questionnaire.from_email, # FROM
                                    "Reference Notification to Applicant", # LIQUID TEMPLATE NAME
                                    {'applicant_full_name' => applicant_answer_sheet.name,
                                     'reference_full_name' => self.name,
                                     'reference_email' => self.email,
                                     'application_url' => edit_answer_sheet_url(applicant_answer_sheet, :host => ActionMailer::Base.default_url_options[:host])})

      self.email_sent_at = Time.now
      self.save(:validate => false)
      
      true
    end
1041965
def index
      @contacts = Contact.all
  
      respond_to do |format|
        format.html # index.html.erb
        format.json { render json: @contacts }
      end
    end
663954
def contact(msg)
      @data = {
          msg: msg,
          client_ip: msg.remote_ip,
          gems: BarkestCore.gem_list(Rails.application.class.parent_name.underscore, 'rails', 'barkest*'),
      }
      mail subject: msg.full_subject, reply_to: msg.your_email
    end
1059343
def send(self, message, envelope_from=None):
        
        assert message.send_to, "No recipients have been added"

        assert message.sender, (
            "The message does not specify a sender and a default sender "
            "has not been configured")

        if message.has_bad_headers():
            raise BadHeaderError

        if message.date is None:
            message.date = time.time()

        ret = None
        if self.host:
            ret = self.host.sendmail(
                sanitize_address(envelope_from or message.sender),
                list(sanitize_addresses(message.send_to)),
                message.as_bytes() if PY3 else message.as_string(),
                message.mail_options,
                message.rcpt_options
            )

        email_dispatched.send(message, app=current_app._get_current_object())

        self.num_emails += 1

        if self.num_emails == self.mail.max_emails:
            self.num_emails = 0
            if self.host:
                self.host.quit()
                self.host = self.configure_host()

        return ret
599454
def update_contact(self, contact_id, email=None, name=None):
        
        params = {}

        if email is not None:
            params['email'] = email

        if name is not None:
            params['name'] = name

        url = self.CONTACTS_ID_URL % contact_id

        connection = Connection(self.token)
        connection.set_url(self.production, url)
        connection.add_header('Content-Type', 'application/json')
        connection.add_params(params)

        return connection.patch_request()
535242
def respond_to_contact_info(self, message):
        """"""
        contacts = self.load("contact_info", {})
        context = {
            "contacts": contacts,
        }
        contact_html = rendered_template("contact_info.html", context)
        self.say(contact_html, message=message)
996257
public function actionContact()
	{
		$model=new ContactForm;
		if(isset($_POST['ContactForm']))
		{
			$model->attributes=$_POST['ContactForm'];
			if($model->validate())
			{
				$name='=?UTF-8?B?'.base64_encode($model->name).'?=';
				$subject='=?UTF-8?B?'.base64_encode($model->subject).'?=';
				$headers="From: $name <{$model->email}>\r\n".
					"Reply-To: {$model->email}\r\n".
					"MIME-Version: 1.0\r\n".
					"Content-Type: text/plain; charset=UTF-8";

				mail(Yii::app()->params['adminEmail'],$subject,$model->body,$headers);
				Yii::app()->user->setFlash('contact','Thank you for contacting us. We will respond to you as soon as possible.');
				$this->refresh();
			}
		}
		$this->render('contact',array('model'=>$model));
	}
1375011
def send(options)
      response = EmailDirect.post "/RelaySends/#{category_id}", :body => options.to_json
      Hashie::Mash.new(response)
    end
1273333
def notify(contact_request)
      @contact_request = contact_request

      mail to: notification_recipients,
           from: notification_sender(contact_request),
           subject: notification_subject
    end
1358040
def get_contact(self, contact_id):
        
        url = self.CONTACTS_ID_URL % contact_id

        connection = Connection(self.token)
        connection.set_url(self.production, url)

        return connection.get_request()
716327
def send_request(request)
      message = RemoteMessage.new(request_message: request).serialize_to_string
      message_size = [message.length].pack('N')
      @ssl_client.write(message_size + message)
    end
218763
def create_contact(self, email=None, first_name=None, last_name=None, phone_number=None):
        
        result = {}
        if email:
            result['email'] = email
        if first_name is not None:
            result['first_name'] = first_name
        if last_name is not None:
            result['last_name'] = last_name
        if phone_number is not None:
            result['phone_number'] = phone_number
        return result if len(result) > 0 else None
21937
function Recipient() {
    /**
     * The method value
     * @member
     */
    this.method = null;
    /**
     * The destination of value
     * @member
     * @type { Destination }
     */
    this.destination = Object.create(Destination.prototype);
    /**
     * The contactId value
     * @member
     */
    this.contactId = null;

}
980587
public function send()
    {
        // The URI has already been overriden (if applicable) by this point.
        $uri = isset($this->request->url) ? $this->request->url : null;
        if ($this->test && !empty($this->request->testUrl)) {
            $uri = $this->request->testUrl;
        }
        $uri = trim($this->renderTokens($uri));
        if (empty($uri)) {
            throw new ContactClientException(
                'No URL was specified for an API operation.',
                0,
                null,
                Stat::TYPE_ERROR,
                false
            );
        }

        $this->setLogs($uri, 'uri');

        $request   = $this->request;
        $transport = $this->transport;
        $options   = [];
        $manual    = isset($request->manual)
            && $request->manual
            && isset($request->template)
            && !empty(trim($request->template));

        // Retrieve/filter/tokenize the Request Body Field values if present.
        $requestFields = [];
        if (!$manual && !empty($request->body) && !is_string($request->body)) {
            $requestFields = $this->fieldValues($request->body);
        }
        $requestFormat = strtolower(isset($request->format) ? $request->format : 'form');
        $this->setLogs($requestFormat, 'format');
        switch ($requestFormat) {
            case 'form':
            default:
                $options['headers']['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8';
                if ($requestFields) {
                    $options['form_params'] = $requestFields;
                }
                break;

            case 'json':
                $options['headers']['Content-Type'] = 'application/json; charset=utf-8';
                if ($requestFields) {
                    $options['json'] = $requestFields;
                }
                break;

            case 'text':
                $options['headers']['Content-Type'] = 'text/plain; charset=utf-8';
                if ($requestFields) {
                    // User specified to send raw text, but used key value pairs.
                    // We will present this as YAML, since it's the most text-like response.
                    $yaml = Yaml::dump($requestFields);
                    if ($yaml) {
                        $options['body'] = $yaml;
                    }
                }
                break;

            case 'xml':
                $options['headers']['Content-Type'] = 'application/xml; charset=utf-8';
                if ($requestFields) {
                    $doc                     = new DomDocument('1.0');
                    $doc->preserveWhiteSpace = false;
                    $doc->formatOutput       = true;
                    $root                    = $doc->createElement(self::XML_ROOT_ELEM);
                    $doc->appendChild($root);
                    foreach ($requestFields as $key => $value) {
                        $element = $doc->createElement($key);
                        $element->appendChild(
                            $doc->createTextNode($value)
                        );
                        $root->appendChild($element);
                    }
                    $xml = $doc->saveXML();
                    if ($xml) {
                        $options['body'] = $xml;
                    }
                }
                break;

            case 'yaml':
                $options['headers']['Content-Type'] = 'application/x-yaml; charset=utf-8';
                if ($requestFields) {
                    $yaml = Yaml::dump($requestFields);
                    if ($yaml) {
                        $options['body'] = $yaml;
                    }
                }
                break;
        }

        // Add the manual template if provided and manual mode is enabled.
        if ($manual) {
            $templateFields = $this->templateFieldValues($request->body);
            $body           = $this->renderTokens($request->template, $templateFields);
            if (!empty(trim($body))) {
                $options['body'] = $body;
                // Prevent double-encoding JSON.
                unset($options['json']);
            }
        } else {
            if (is_string($request->body) && !empty(trim($request->body))) {
                // For backward compatibility, support body as a string.
                $body = $this->renderTokens($request->body);
                if (!empty(trim($body))) {
                    $options['body'] = $body;
                }
            }
        }

        // Header Field overrides.
        if (!empty($request->headers)) {
            $headers = $this->fieldValues($request->headers);
            if (!empty($headers)) {
                if (isset($options['headers'])) {
                    $options['headers'] = array_merge($options['headers'], $headers);
                } else {
                    $options['headers'] = $headers;
                }
            }
        }

        $method = trim(strtolower(isset($request->method) ? $request->method : 'post'));
        $this->setLogs($method, 'method');
        $startTime = microtime(true);
        switch ($method) {
            case 'delete':
                $this->setLogs($options, 'options');
                $transport->delete($uri, $options);
                break;

            case 'get':
                if ($requestFields) {
                    $options['query'] = $requestFields;
                    // GET will not typically support form params in addition.
                    unset($options['form_params']);
                }
                $this->setLogs($options, 'options');
                $transport->get($uri, $options);
                break;

            case 'head':
                $this->setLogs($options, 'options');
                $transport->head($uri, $options);
                break;

            case 'patch':
                $this->setLogs($options, 'options');
                $transport->patch($uri, $options);
                break;

            case 'post':
            default:
                $this->setLogs($options, 'options');
                $transport->post($uri, $options);
                break;

            case 'put':
                $this->setLogs($options, 'options');
                $transport->put($uri, $options);
                break;
        }
        $transportRecords = $transport->getRecords();
        if ($transportRecords) {
            $debug = [];
            foreach ($transportRecords as $transportRecord) {
                if (
                    isset($transportRecord['channel'])
                    && 'guzzle.to.curl' == $transportRecord['channel']
                    && isset($transportRecord['message'])
                ) {
                    $debug[] = $transportRecord['message'];
                }
            }
            if ($debug) {
                $this->setLogs($debug, 'debug');
            }
        }
        $this->setLogs(microtime(true) - $startTime, 'duration');
        if ($this->test) {
            $this->setLogs($this->tokenHelper->getContext(true), 'availableTokens');
        }
    }
1305597
def send(self, send_to, from_who, subject, message, reply_to=None):
        
        # Set the reply to address if it's None
        if reply_to is None:
            reply_to = from_who

        try:
            em_msg = text.MIMEText(
                _text=message.encode('utf8'),
                _subtype='plain',
                _charset='utf8'
            )
            em_msg["Subject"] = subject
            em_msg["From"] = from_who
            em_msg["To"] = send_to
            em_msg["Reply-To"] = reply_to

            # Send Customer Messages
            built_message = em_msg.as_string()

            self.smtp.sendmail(
                from_addr=em_msg["From"],
                to_addrs=em_msg["To"],
                msg=built_message
            )
        except Exception as exp:
            msg = 'Failed to send message due to "%s"' % exp
            self.log.error(msg)
            raise cloudlib.MessageFailure(msg)
        else:
            self.log.debug(message)
        finally:
            self.smtp.quit()