Jump to content

Automated email

Go to solution Solved by colonel_mortis,

If you're using PHP on your server, you can use the mail function. The syntax is

mail ($to, $subject, $body, $headers)

where $to is a string of comma-separated to addresses in the format Name <address@theirdomain>, eg

$to = "The First User <firstuser@[member='Example'].com>, Another User <contact@[member='Example'].net>"

$subject should just be a single line string of your subject line.
$body is the body of your email. It's possible to send the email as html, or you can just use plain text. You have to use CRLF to separate the lines, which means that you should use double quotes around the string, and use \r\n to indicate a line break, eg

$body = "Dear Mr Example,\r\n" .        "This is an example email. Notice how I am adding \\r\\n at the end of every line\r\n" .        "End of message";

$headers should be a CRLF-delimited set of email headers, in the format Headername: content. You must include a From header, and there are loads of other ones that can be included. eg

$headers = "From: Benny123 <benny123@[member='Example'].com>\r\n" .           "CC: AnExampleUser <exampleuser@[member='Example'].net>\r\n" .           //If you want to send it as HTML instead of plain text           "MIME-Version: 1.0\r\n" .           "Content-Type:  text/html; charset=ISO-8859-1";

The documentation for this function can be found here.

PS ignore the @ stuff, that's forum tagging, you can figure out how it should look like

you cant really have a website mail someone.

 

you'd have to add the emails into a database, and have something else read the emails from that database and send said automated email.

---

 

that said, why would you do this?

Link to comment
https://linustechtips.com/topic/437229-automated-email/#findComment-5861003
Share on other sites

Link to post
Share on other sites

you cant really have a website mail someone.

 

you'd have to add the emails into a database, and have something else read the emails from that database and send said automated email.

---

 

that said, why would you do this?

Just for a little project I might persue

Link to comment
https://linustechtips.com/topic/437229-automated-email/#findComment-5861010
Share on other sites

Link to post
Share on other sites

you cant really have a website mail someone.

 

you'd have to add the emails into a database, and have something else read the emails from that database and send said automated email.

---

 

that said, why would you do this?

 

Incorrect, there is plenty of back-end web programming ways to send emails.

Link to comment
https://linustechtips.com/topic/437229-automated-email/#findComment-5861178
Share on other sites

Link to post
Share on other sites

Depending on your setup, any email you send will most likely just go into the destination user's spam inbox.

If you're sending emails from your own IP, make sure it isn't blacklisted with Spamhaus, or else it most likely won't reach Gmail or Yahoo inboxes at all. https://www.spamhaus.org/lookup/ http://www.spamhaus.org/pbl/

 

If you own the server, then most likely you can send email via a linked Gmail(or other webmail) account.

Speedtests

WiFi - 7ms, 22Mb down, 10Mb up

Ethernet - 6ms, 47.5Mb down, 9.7Mb up

 

Rigs

Spoiler

 Type            Desktop

 OS              Windows 10 Pro

 CPU             i5-4430S

 RAM             8GB CORSAIR XMS3 (2x4gb)

 Cooler          LC Power LC-CC-97 65W

 Motherboard     ASUS H81M-PLUS

 GPU             GeForce GTX 1060

 Storage         120GB Sandisk SSD (boot), 750GB Seagate 2.5" (storage), 500GB Seagate 2.5" SSHD (cache)

 

Spoiler

Type            Server

OS              Ubuntu 14.04 LTS

CPU             Core 2 Duo E6320

RAM             2GB Non-ECC

Motherboard     ASUS P5VD2-MX SE

Storage         RAID 1: 250GB WD Blue and Seagate Barracuda

Uses            Webserver, NAS, Mediaserver, Database Server

 

Quotes of Fame

On 8/27/2015 at 10:09 AM, Drixen said:

Linus is light years ahead a lot of other YouTubers, he isn't just an average YouTuber.. he's legitimately, legit.

On 10/11/2015 at 11:36 AM, Geralt said:

When something is worth doing, it's worth overdoing.

On 6/22/2016 at 10:05 AM, trag1c said:

It's completely blown out of proportion. Also if you're the least bit worried about data gathering then you should go live in a cave a 1000Km from the nearest establishment simply because every device and every entity gathers information these days. In the current era privacy is just fallacy and nothing more.

 

Link to comment
https://linustechtips.com/topic/437229-automated-email/#findComment-5861421
Share on other sites

Link to post
Share on other sites

If you're using PHP on your server, you can use the mail function. The syntax is

mail ($to, $subject, $body, $headers)

where $to is a string of comma-separated to addresses in the format Name <address@theirdomain>, eg

$to = "The First User <firstuser@[member='Example'].com>, Another User <contact@[member='Example'].net>"

$subject should just be a single line string of your subject line.
$body is the body of your email. It's possible to send the email as html, or you can just use plain text. You have to use CRLF to separate the lines, which means that you should use double quotes around the string, and use \r\n to indicate a line break, eg

$body = "Dear Mr Example,\r\n" .        "This is an example email. Notice how I am adding \\r\\n at the end of every line\r\n" .        "End of message";

$headers should be a CRLF-delimited set of email headers, in the format Headername: content. You must include a From header, and there are loads of other ones that can be included. eg

$headers = "From: Benny123 <benny123@[member='Example'].com>\r\n" .           "CC: AnExampleUser <exampleuser@[member='Example'].net>\r\n" .           //If you want to send it as HTML instead of plain text           "MIME-Version: 1.0\r\n" .           "Content-Type:  text/html; charset=ISO-8859-1";

The documentation for this function can be found here.

PS ignore the @ stuff, that's forum tagging, you can figure out how it should look like

HTTP/2 203

Link to comment
https://linustechtips.com/topic/437229-automated-email/#findComment-5861593
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×