JsonTeh
Posts: 1
|
Posted: 05/07/2015, 9:14 PM |
|
I am a newbie to CodeCharge and also PHP language and trying hard to learn.
I want to do a simple send email to pop3 email account (gmail).
This is my interface, simple 3 textbox and 1 text area
<body>
<p><label for="TextBox1" style="display: none;">From </label><input id="TextBox1" name="{TextBox1_Name}"> </p>
<p><label for="TextBox2" style="display: none;">To </label><input id="TextBox2" name="{TextBox2_Name}"></p>
<p><label for="TextBox3" style="display: none;">Subject </label><input id="TextBox3" name="{TextBox3_Name}"></p>
<p><label for="TextArea1" style="display: none;">Content </label> <textarea style="WIDTH: 135px; HEIGHT: 72px" id="TextArea1" rows="4" cols="13" name="{TextArea1_Name}">{TextArea1}</textarea></p>
<p>
<!-- BEGIN Button Button1 --><input id="Button1" value="Button1" alt="Button1" type="submit" name="{Button_Name}"><!-- END Button Button1 --></p>
</body>
And this is my mail function code for the button 1
//Send Email @8-D6FFBFF8
global $TextBox2;
global $TextBox1;
global $TextBox3;
global $TextArea1;
ini_set("SMTP", "localhost");
$to = $Container->TextBox2->GetText();
$subject = $Container->TextBox3->GetText();
$message = $Container->TextArea1->GetText();
$from = $Container->TextBox1->GetText();
$charset = "Windows-1252";
$transferEncoding = "";
$additional_headers = "From: $from\nReply-To: $from\nContent-Type: text/html; charset=$charset\nContent-Transfer-Encoding: $transferEncoding";
mail ($to, $subject, $message, $additional_headers);
ini_restore("SMTP");
//End Send Email
When i run the page, fill in all the information and click the button, nothing ever happen.
Can i know what is the problem here? Will appreciate for the help
|
|
|
MichaelMcDonald
Posts: 640
|
Posted: 05/08/2015, 3:57 AM |
|
Here's one we prepared earlier...
Might give you some ideas.
Am guessing you have a mail server on your local computer..
http://forums.yessoftware.com/posts.php?post_id=123299
_________________
Central Coast, NSW, Australia.
|
|
|
|