mailto link with HTML body

As you can see in RFC 6068, this is not possible at all: The special <hfname> “body” indicates that the associated <hfvalue> is the body of the message. The “body” field value is intended to contain the content for the first text/plain body part of the message. The “body” pseudo header field is primarily intended … Read more

How to send an email from JavaScript

You can’t send an email directly with javascript. You can, however, open the user’s mail client: window.open(‘mailto:[email protected]’); There are also some parameters to pre-fill the subject and the body: window.open(‘mailto:[email protected]?subject=subject&body=body’); Another solution would be to do an ajax call to your server, so that the server sends the email. Be careful not to allow anyone … Read more

Send email using the GMail SMTP server from a PHP page

// Pear Mail Library require_once “Mail.php”; $from = ‘<[email protected]>’; $to = ‘<[email protected]>’; $subject=”Hi!”; $body = “Hi,\n\nHow are you?”; $headers = array( ‘From’ => $from, ‘To’ => $to, ‘Subject’ => $subject ); $smtp = Mail::factory(‘smtp’, array( ‘host’ => ‘ssl://smtp.gmail.com’, ‘port’ => ‘465’, ‘auth’ => true, ‘username’ => ‘[email protected]’, ‘password’ => ‘passwordxxx’ )); $mail = $smtp->send($to, $headers, … Read more

Sending email in .NET through Gmail

Be sure to use System.Net.Mail, not the deprecated System.Web.Mail. Doing SSL with System.Web.Mail is a gross mess of hacky extensions. using System.Net; using System.Net.Mail; var fromAddress = new MailAddress(“[email protected]”, “From Name”); var toAddress = new MailAddress(“[email protected]”, “To Name”); const string fromPassword = “fromPassword”; const string subject = “Subject”; const string body = “Body”; var smtp … Read more

Sending Email in Android using JavaMail API without using the default/built-in app

Send e-mail in Android using the JavaMail API using Gmail authentication. Steps to create a sample Project: MailSenderActivity.java: public class MailSenderActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); final Button send = (Button) this.findViewById(R.id.send); send.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { try { GMailSender sender = new GMailSender(“[email protected]”, “password”); sender.sendMail(“This … Read more