H X
H X

Reputation: 43

how to allow users of a website to email their contacts?

I just would like some guidance as to where to start this project. If I want to enable users of my website, to email all their contacts about an update (similar to linkedin does when you join) how should I go about doing this? I honestly have no idea where to begin.

Upvotes: 0

Views: 155

Answers (2)

Cole Busby
Cole Busby

Reputation: 398

I don't know what programming language you are writing this in so heres some pseudocode.

foreach contacts in databaseresults{
    $To = '"' . $databaseresults['first_name'] . '" <' . $databaseresults['email'] . '>';
    $Headers = "From: \" Some Company \" <[email protected]>"."\r\n".
               "Content-type: multipart/mixed; boundary=$someMD5Hash"."\r\n";
    $Message = "--$someMD5Hash\r\nContent-Type: text/html;" . "\r\n" . $someHTMLContent . "\r\n\r\n" . "--$someMD5Hash--";
    $subject = "A Squirrel Added a Nut to your pile!";
    mail($To,$Subject,$Message,$Headers);
}

At least thats some PHP to work

Upvotes: 1

McAden
McAden

Reputation: 13972

I'd start by looking at OAuth - the user allowing your service access of some form to their account. You can start with Google's API info here: https://developers.google.com/accounts/docs/OAuth2

Upvotes: 1

Related Questions