How do I send email?

Get help using Construct 2

Post » Mon Jan 30, 2017 8:35 pm

Hi i would like to achive this:

when the player beat a special boss, a screenshot is taken from the app and then sended to an email, how can i achieve that?
B
39
S
16
G
7
Posts: 1,727
Reputation: 9,865

Post » Tue Jan 31, 2017 4:59 pm

You can do it in Java with the javax.mail library. That is how I send emails.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857

Post » Tue Jan 31, 2017 5:39 pm

its not an html5 game its for android devices
B
39
S
16
G
7
Posts: 1,727
Reputation: 9,865

Post » Tue Jan 31, 2017 10:01 pm

B
111
S
28
G
48
Posts: 1,882
Reputation: 36,428

Post » Tue Jan 31, 2017 11:42 pm

imothep85 wrote:Hi i would like to achive this:

when the player beat a special boss, a screenshot is taken from the app and then sended to an email, how can i achieve that?


You can certainly send an html email with a picture embeded, I dont know about a screenshot from android, but you could send one from pc.

I have a tutorial to send a basic email here https://www.scirra.com/tutorials/4897/sending-an-email-from-construct2

To add a picture all you have to do is add an html element inside, the php, example below.

<?php
$date=date('l jS \of F Y h:i:s A');
$msg ="<html>
<head>
<style>

table {

font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}

td, th {


border: 1px solid black;
border-collapse: collapse;


padding: 8px;
}

th {background-color: DarkKhaki ;
text-align: center;
}
td {background-color: OliveDrab ;}
td {color: white ;
text-align: center;}



</style>
</head>
<body>

<table>
<th>Picture sent on $date</th>
</table>
<img src=\"http://www.yoursever.com/yourpic.png\">

</body>
</html>";
//email information

$to = '[email protected]';

$subject = "test1";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();


mail($to,$subject,$msg,$headers);
?>

This only uses php mail, and no other plugin or mailer
This is tested, and works, It might go in your junk mail, and takes a while to be received, good luck.
Bushy Ball\Boatman Bill\Sticky Web\Snake

Image ImageImageImage

During the gold rush it was a good time to be in the pick and shovel business
B
47
S
14
Posts: 253
Reputation: 5,389

Post » Wed Feb 01, 2017 10:57 am

what im trying to achieve is only for mobile devices Android, not for pc
B
39
S
16
G
7
Posts: 1,727
Reputation: 9,865


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 19 guests