İçeriğin rss beslemesi kullanımda değil Soru - Cevap Bölümü / Kategori: Programlama

25/08/2008 - 17:22:48 cevap (3) Okunma : 304 Bu yazıyı 0 kişi tuttu.

E-mail

Flash’ta mail gönderme formu asp ile birlikte nasıl yapılır…

adres youngwe profilini göster
Ertuğrul Erkan 25.08.2008 18:11:52
En iyi cevap mı ?

flash ta mail göndermenin hiçbir farkı yok. sadece veriyi olduğu gibi asp ye yollayacaksınız. yani bir formdan post ediyormuş gibi. benim veriyi flashtan php / asp ye post etme dersim vardı. isterseniz inceleyin.

asp den nasıl mail atılıyor onu bilmeniz lazım. çünkü tüm işi o yapıyor…

adres muratkgirgin profilini göster
Murat Kgirgin 25.08.2008 18:56:32
En iyi cevap mı ?

Actionscript.org ‘ dan bir kod blogu,

asp,php,cgi ile beraber calisiyor.

Actionscript Bölümü

var serverLang:String = "asp";

bolumne String="asp, php ya da cgi" yazabilirsiniz


var serverLang:String = "asp"; //Create a loadvars object named email_lv
var email_lv:LoadVars = new LoadVars(); //this function is called when email_lv loads the server-side script.
email_lv.onLoad = function(success) {
 //If the script was successfully loaded, this condition is run
 if (success) {
  /* Though the server-side script was loaded, it does not mean it was 
      executed successfully. This condition gets a response from the
   server-side script and determines if it was truly successful. */
  if (email_lv.server_mes == "ok") {
   status_txt.text = "Email Sent";
   /* You can add additional code here. This is only run
      if everything went as planned. */
  }
 } else {
  //email failed to send, but script did load. Likely a server issue.
  status_txt.text = "Email Failed";
 }
}; /*This is the onRelease function for "submit_btn" button. This is only run
  if the button was pressed. */
submit_btn.onRelease = function() {
 /* Here we are validating the data. This insures the email address contains
    both the "@" and ".", If not, it stops the script and alerts the user. */
 if (!email_txt.length || email_txt.indexOf("@") == -1 || email_txt.indexOf(".") == -1) {
  status_txt.text = "Invalid Email.";

 //This validates the subject line contains text
 } else if (!subject_txt.length) {
  status_txt.text = "Missing Subject";

 //This validates the message body contains text 
 } else if (!message_txt.length) {
  status_txt.text = "Missing Message";

 //If everything is filled out correctly, this is run. 
 } else {
  //Collects the data from the text boxes and gives it to email_lv
  email_lv.email_txt = email_txt.text;
  email_lv.subject_txt = subject_txt.text;
  email_lv.message_txt = message_txt.text;

  /* Finally, send the data to the server and get a response. 
     As mentioned above, serverlang holds the file extendion for
     the server side language. You can hard code the complete file name. */
  email_lv.sendAndLoad("SendMail."+serverLang, email_lv, "POST");
 }
};

ASP Bölümü

<%
dim themail, thename, themessage, i

'Gets the incoming variables from flash
themail = Request("email_txt")
thesubject = Request("subject_txt")
themessage = Request("message_txt")

'Decalre and create email object
dim objmail

set objmail = Server.CreateObject("CDONTS.Newmail")
'error handler, if error encountered, ignore it and proceed
On Error resume next

'build the email using the variables from flash
objmail.From = themail
objmail.To = themail
objmail.Subject = thesubject
objmail.Body = themessage
objmail.Send
'error handler, if error encountered, ignore it and proceed
On Error resume next

'If any errors were encounter then run this code
If Err.Number <> 0 then
'tells flash ASP failed and terminates the ASP file.
Response.Write "&server_mes=fail"
Response.End 
else
'Send message back to flash saying everything was ok.
Response.Write "&server_mes=ok"
End if 

%>

PHP Bölümü

<?php //tells the server this is php
//-------------------------------------
// the below code set the headers. There can be a bit difficult to understand fully.
// Information about them and all the commands below can be found at the PHP manual
// NOTE TO ALL USERS - Gmail and some older server configs DO NOT like \r\n, just use \n with it comes to html emails.
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: Your Websites Name Here <' . $_POST['email'] . '>' . "\r\n"; //you can put your websites name in here or anything else you like
//$headers .= 'Bcc: <a href="mailto:another@email.com'">another@email.com'</a> . "\r\n";   //this is optional.
//------------------------------
// gets variables from flash
$to = <a href="mailto:'your@email.address'">'your@email.address'</a>  //inset the email address it goes to here
$subject = $_POST['subject_txt'];
$message = $_POST['message_txt'];
if ($_POST['message_txt'] != "") { //this checks to make sure someone didn't visit the page manually by making sure message_txt is not empty
 $ok = mail($to, $subject, $message, $headers); //this line sends the mail and returns true or false
 if($ok) {
  echo "&server_mes=ok&"; //if mail was send print to the screen "&server_mes=ok"  
 } else {
  echo "&server_mes=fail&"; // if mail was NOT sent, print to the screen "&server_mes=fail"
 }
}
?>

PERL (CGI) Bölümü

#!/usr/local/bin/perl

require "subparse.lib";
&Parse_Form;

$theMail = $formdata{'email_txt'};
$theSubject = $formdata{'subject_txt'};
$theMessage = $formdata{'message_txt'};


open (MAIL, "|/usr/sbin/sendmail -t") || &ErrorMessage;
print MAIL "To: $theMail \nFrom: $theMail\n";
print MAIL "Subject: $theSubject\n";
print MAIL "$theMessage\n";
close (MAIL);

print "Content-type: text/html\n\n";
Print "&server_mes=ok";

sub ErrorMessage {
print "&server_mes=Fail";
exit; }

Kaynak: actionscript.org

adres youngwe profilini göster
Ertuğrul Erkan 25.08.2008 19:19:21
En iyi cevap mı ?

aslında böyle biraz yanlış oldu. araştırmaya yöneltmek için demiştim ben ama :) :/

aç-kapa Bu Yazıyı Tutanlar

bu yazıyı tutan kimse yok.

yeni üyelik | şifremi unuttum

aç-kapa Yarışma Fikir10000 Dijital Pazarlama Fikir Yarışması

Fikir10000 Dijital Pazarlama Fikir Yarışması

ADTECH tarafından düzenlenen Fikir10000 yarışmasına; dijital pazarlama ile ilgili size ait olan fikrinizle katılabilir ve 10.000 YTL’lik birinci...
Kategori: Yarışma

aç-kapa Toplantı Kahraman ve need4code.com Projesi Connect Toplantısı

Kahraman ve need4code.com Projesi Connect Toplantısı

Selam arkadaslar, Programlama ile uğraşanların hayatlarını kolaylaştıracak desktop ve web tabanlı ortak iki proje ile ilgili 3. toplantımızı 16Aralı...
Kategori: Toplantı

aç-kapa Yarışma 7Dx Demoscene Party

7Dx Demoscene Party

2002 yılından beri amatör bilgisayar kültürü ile ilgilenen insanları bir araya getirmeyi hedefleyen 7DX parti serisinin bu seneki ayağı olan 7D8 Demo ...
Kategori: Yarışma

aç-kapa Eğitim Türkiye'de İnternet Konferansı - Internet Teknolojileri Derneği -22-23 Aralık ODTÜ

Türkiye'de İnternet Konferansı - Internet Teknolojileri Derneği -22-23 Aralık ODTÜ

Etkin Katılım Çağrısı Türkiye’de Internet ile ilgili grupları biraraya getirerek İnternet’i tum boyutlarıyla tanıtmak, gelistirmek, tartı...
Kategori: Eğitim

aç-kapa Konferans Bilgi Güvenliği ve Kriptoloji Konferansı

Bilgi Güvenliği ve Kriptoloji Konferansı

Önemli Tarihler: Etkinlik Tarihi : 24-26 Aralık 2008 Son Bildiri Gönderme Tarihi : 20 Ekim 2008 Bildiri Kabul Tarihi Bildirimi :...
Kategori: Konferans

üyeler Son Kahramanlar...

stats Kimler Burada? web stats

Son 1 dakika içinde MMIstanbul' da 625 (0 kayıtlı, 625 ziyaretçi) kullanıcı varmış. Login durumda olanlar aşağıda:

coldfusion mysql ubuntu
 
sponsor adobe istanbul