wysyłanie email

0

Cześć
Walczę z przerabianiem gotowej strony i chcę aby formularz kontaktowy działał poprawnie
co powinienem wyedytować w tym pliku abym otrzymywał emaile?

<%
for i=1 to 7
message=Request("message")
next
message=message + Request("message")
smtpServer = "enter your SMTP SERVER HERE"
smtpPort = 25


name = Request("Your_Name:")
Set myMail = CreateObject("CDO.Message")
myMail.Subject = "from " & name
myMail.From = Request("Your_Email:")
myMail.To = Request("recipient")
myMail.HTMLBody = "<html><head><title>Contact letter</title></head><body><br>" & message & "</body></html>"
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtpServer
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = smtpPort
myMail.Configuration.Fields.Update
myMail.Send

%>

pozdrawiam

0

Ale co toto jest? Jaki język?

0

jak jakiś dziwny asp wygląda

0

guess VB

1

smtpServer = "enter your SMTP SERVER HERE"

No przecież widać - podaj w tamtym miejscu adres serwera SMTP. Ale jaki nie podasz to i tak to nie zadziała, bo mamy XXI wiek i większość serwerów SMTP wymaga autoryzacji.

Jak zrobić autoryzację masz na tej stronie podanej wyżej, tam jest jakieś przypisywanie nazwy użytkownika i hasła.

Ale ASP to dość stare jest, naprawdę musisz tego używać?

0

dzięki, spróbuję to dodać
a co innego proponujesz użyć?
no bo chyba muszę tego używać, modyfikuję tą stronę a nie jestem na tyle biegły w programowaniu żeby skorzystać z czegoś innego

0

chciałbym powrócić do tematu,
co dokładnie muszę tu umieścić aby możnabyło wysłać email zamiast tego co miałem (kilka postów wyżej)
czy coś takiego: ?
<%
for i=1 to 7
message=Request("message")
next
message=message + Request("message")
smtpServer = "smtp.wp.pl"
smtpPort = 587

	name = Request("Your_Name:")
	Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory.

Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network).

Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Temat"
objMessage.From = """nadawca"" [email protected]"
objMessage.To = "[email protected]"
objMessage.TextBody = "Serwer "

'==This section provides the configuration information for the remote SMTP server.

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.wp.pl"

'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoNTLM

'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

'Use SSL for the connection (False or True)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False

'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objMessage.Configuration.Fields.Update

'==End remote SMTP server configuration section==
objMessage.Send

%>

doświadczalnie sprawdzam, że wyświetla się po angielsku, że wiadomość wysłana poprawnie ale w skrzynce się nic nie pojawia. . .
gdzie mam błąd?

0

p.s. mam jeszcze plik php o następującej treści:

<?php Error_Reporting(E_ALL & ~E_NOTICE); while ($request = current($_REQUEST)) { if (key($_REQUEST)!='recipient') { $pre_array=split ("&777&", $request); $post_vars[key($_REQUEST)][0]=preg_replace ("/<[^>]*>/", "", $pre_array[0]); $post_vars[key($_REQUEST)][1]=preg_replace ("/<[^>]*>/", "", $pre_array[1]); } next($_REQUEST); } reset($post_vars); $subject="From ".$post_vars['your_name'][0] ; $headers= "From: ".$post_vars['your_email'][0] ."\n"; $headers.='Content-type: text/html; charset=iso-8859-1'; $message=''; while ($mess = current($post_vars)) { if ((key($post_vars)!="i") && (key($post_vars)!="your_email") && (key($post_vars)!="your_name")) { $message.="".$mess[1]."   ".$mess[0]."
"; } next($post_vars); } mail($_REQUEST['recipient'], $subject, " <html> <head> <title>Contact letter</title> </head> <body>
".$message." </body> </html>" , $headers); echo ("Your message was successfully sent!"); ?> <script> resizeTo(300, 300); </script>

co w nim zmienić?

1 użytkowników online, w tym zalogowanych: 0, gości: 1