Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Fri Nov 15, 2019 7:34 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Send e-mails with PHP
PostPosted: Wed Jul 07, 2010 11:16 am 
Offline

Joined: Thu Feb 22, 2007 7:08 pm
Posts: 1384
This functions can help you to let send e-mails from your users without write your user name and password. Some pros:
Quote:
Cross-Platform
No e-mail or password is required in RB
Changing your e-mail adress is allways possible at any time, not required to change it in RB

1. Create a text file and add this code(don't forgot to replace the line "email@domain.com" with your e-mail address and "subject" with your own subject):
<?
$mail = "email@domain.com";
$subject = "subject";

if(isset($_POST['action']))
{
switch($_POST['action'])
{
case 'submit':

$message = "$_POST[email]";

$i = @mail($mail, addslashes($subject), $message, "from: $_POST[email]");
}
}
?>

<html>
<head>
<body>
<form name="form">
<p><input name="email" type="hidden" id="email" value="<?=$_POST['email']?>"></p>
<p><input name="action" type="hidden" id="action" value="submit"></p>
</form>
</body>
</html>

2. Save the text file as email.php for example
3. Add the file email.php to your server
4. In RB add a editfield(textfield in new versions) and a button, and add this into the button action event:
dim h as new httpsocket
dim form as new dictionary

form.value("email") = editfield1.text // this is the field where the user write his e-mail address
form.value("action") = "submit"

h.setformdata(form)
h.post("http://www.yourdomain.com/email.php")


Top
 Profile  
Reply with quote  
 Post subject: Re: Send e-mails with PHP
PostPosted: Wed Jul 07, 2010 2:36 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
This of course assumes the following..

a) you have your own server or access to one.
b) the server you have access to supports PHP
c) said server has a Webmail service operating.

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group