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
37
S
15
G
7
Posts: 1,680
Reputation: 9,612

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
Company name changed to avoid Facebook-type shenanigans

"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
22
S
6
G
1
Posts: 1,415
Reputation: 4,824

Post » Tue Jan 31, 2017 5:39 pm

its not an html5 game its for android devices
B
37
S
15
G
7
Posts: 1,680
Reputation: 9,612

Post » Tue Jan 31, 2017 10:01 pm

B
109
S
26
G
46
Posts: 1,886
Reputation: 35,168

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
45
S
13
Posts: 247
Reputation: 5,247

Post » Wed Feb 01, 2017 10:57 am

what im trying to achieve is only for mobile devices Android, not for pc
B
37
S
15
G
7
Posts: 1,680
Reputation: 9,612


Return to How do I....?

Who is online

Users browsing this forum: blue visionary, OBLIVION and 14 guests