# com.cordova.smtp.client

> smtpclient

Latest version **1.0.0** (published 2017-07-13) · Miami Dade license · 0 weekly downloads

## Install

```sh
npm install com.cordova.smtp.client
pnpm add com.cordova.smtp.client
yarn add com.cordova.smtp.client
bun add com.cordova.smtp.client
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-07-13 |
| First published | 2017-07-13 |
| Weekly downloads | 0 |
| License | Miami Dade |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Nelson Medina |
| Maintainers | nelsitox |

## Links

- npm: https://www.npmjs.com/package/com.cordova.smtp.client
- npm.io page: https://npm.io/package/com.cordova.smtp.client

## Recent versions

- 1.0.0 (latest) — 2017-07-13

## README

# Cordova SMTP Client

Simple pluging that sends an email with or without attachments without prompt the user.

## Using

Install iOS and/or Android platform

    cordova platform add ios
    cordova platform add android

Install the plugin using your any plugman compatible cli

    $ cordova plugin add https://github.com/albernazf/cordova-smtp-client.git

Under the plugins / com.cordova.smtp.client / www folder you will find a Typescript file to help you use the plugin (not mandatory) MailSettings.ts, if you are not using typescript there is also a javascript version of it under the same folder MailSettings.js.

On your javascript call use a code similar to this.

	var mailSettings = {
	    emailFrom: "emailFrom@domain.com",
	    emailTo: "emailTo@domain.com",
	    smtp: "smtp-mail.domain.com",
	    smtpUserName: "authuser@domain.com",
	    smtpPassword: "password",
	    attachments: ["attchament1","attchament2"],
	    subject: "email subject",
		textBody: "write something within the boddy of the email"
	};
	            
	var success = function(message) {
		alert(message);
	}
	
	var failure = function(message) {
		alert("Error sending the email");
	}			
				
	smtpClient.sendMail(mailSettings, success, failure);

The attachments is an array of strings where when using IOS the files needs to be in DATA_URI format and when Android should be the path of the file.
	
The return object "message" has the following structure

	{
	    success : bool,
		errorCode : int,
		errorMessage : string	    
	}

---
_Source: https://npm.io/package/com.cordova.smtp.client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
