\' Hvis formen bliver kaldt undersøg om felterne er udfyldt \' korrekt. Er de ikke udfyldt stop med \"response.end\".
if(action=\"send\") then
if not (len(nummer)=8) then response.write \"Du skal indtaste et tlf. nummer\" response.end elseif (besked=\"\") then response.write \"Besked-feltet skal udfyldes\" response.end
\' -----------Ellers lav meddelelse. else Set JMail = Server.CreateObject(\"JMail.SMTPMail\") JMail.ServerAddress = smtpserver JMail.subject = service JMail.sender= afsender JMail.Body = \"Besked fra \" &navn&\" : \" & besked
JMail.AddRecipient nummer&\"@\"&smsserver \' ----- Send meddelelsen til modtager! JMail.Execute
\'----- Skriv at meddelelsen er sendt.
response.write \"<h2 align=\"\"center\"\">Beskeden blev sendt til \" & nummer & \"<br><br>\"& besked & \"</h2>\" \'------ Ryd op. Set JMail = Nothing
smtpserver=\"mail2.infopaq.dk\" smsserver=\"sms.mobilix.dk\" afsender=\"no@nobody.dk\" service=\"\" til smtpserver=\"mail.a0.dk\" eller smtp.a0.dk eller lign. smsserver=\"sms.mobilix.dk\" afsender=\"din email adr@a0.dk\" service=\"\"
Jeg pastede lige din kode. Jeg har en sonofon-\"telefon\" så jeg prøvede for sjov at skrive note.sonofon.dk og det virkede. Så enten holder det ikke helt med mobilix eller også har de et problem med deres server.
Tdaugaard\'s kode så den kun sender via mobilix (dog ikke testet)
<% \' ******************************************************************************************* \' * SMS Sender with support for sending multiple messages at one time, allowing one to send * \' * a long message cut into smaller messages that fit on a mobile phone. Uses a WordWrap * \' * function to ensure it won\'t cut off in the middle of a word. * \' * * \' * v1.1 - Option to use either the JMail or ASPMail SMTP mail component. * \' * v1.2 - Optional IP, Date/Time, Number sent to and \"from\" logging. * \' ******************************************************************************************* \' * Eksperten.dk Reference: 38893 * \' *******************************************************************************************
\' *** Logging function setting *** \' NOTE: Requires access to the FileSystemObject and that there is writing rights in the directory \' where this script resides.
intLog = True \' Default: True
\' *** SMTP server & afsender mail instillinger ***
strSMTP = \"mail.tdaugaard.dk\" \' SMTP server strAfs = \"postmaster@tdaugaard.dk\" \' En gyldig POP3 konto
\' *** Variables passed by submission of form *** {DO NOT ALTER}
Function Wrap(ByVal Text, ByVal WrapChar, ByVal WrapAt) \' ***************************************************************************************************** \' * WordWrap v1.2 - WordWraps a string off as near as possible to the specified max character amount * \' * By Thomas Daugaard, December 11th, 2000. * \' * * \' * Arguments: Text : The string to wordwrap * \' * WrapChar : A string specifying how/with what to wrap the string. Default is <br> * \' * WrapAt : Numeric value specifying the maximum amount of characters allowed in a * \' * string. Wraps backwards in the string to ensure that the max value is meet. * \' * * \' * Note: Arguments are passed By Value, not reference. * \' *****************************************************************************************************
Text = Trim(CStr(Text)) If Len(Text) =< WrapAt Or Len(Text) = 0 Or InStr(Text, \" \") = 0 Then Wrap = \"\" & Text: Exit Function If Len(WrapChar) = 0 Then WrapChar = \"<br>\"
Do If Len(Text) < WrapAt Then strFinal = strFinal & Text: Exit Do
strPart = Left(Text, WrapAt): intOff = WrapAt If Not Right(strPart, 1) = \" \" Then intOff = InStrRev(strPart, \" \") If intOff = 0 Then intOff = InStr(Text, WrapAt, \" \") If intOff = 0 Then strPart = Text End If strPart = Left(Text, intOff)
ASPMail.RemoteHost = strSMTP ASPMail.FromAddress = strAfs ASPMail.AddRecipient \"\", (strNummer & strDom) End If
If Len(strBesked) > intMsgSize then strWrapped = Split(Wrap(strBesked, \"|\", intMsgSize), \"|\")
For Index = 0 To UBound(strWrapped) Select Case intMailer Case 0: JMail.Body = strFra & strWrapped(Index): JMail.Execute Case 1: ASPMail.BodyText = strFra & strWrapped(Index): ASPMail.SendMail End Select Next
intMsgSize = UBound(strWrapped) + 1 Else Select Case intMailer Case 0: JMail.Body = strFra & strBesked: JMail.Execute Case 1: ASPMail.BodyText = strFra & strBesked: ASPMail.SendMail End Select
intMsgSize = 1 End If
Set JMail = Nothing
bolValid = True Select Case (intMsgSize > 1) Case True: strSendt = \"<font face=\'Tahoma\' size=2 color=#008000>Din besked blev sendt af <b>\" & intMsgSize & \"</b> SMS´er til <b>\" & strNummer & \"</b>.</font>\" Case False: strSendt = \"<font face=\'Tahoma\' size=2 color=#008000>Din besked blev sendt til <b>\" & strNummer & \"</b>!</font>\" End Select Else strSendt = \"<font face=\'Tahoma\' size=2 color=#800000>Beskeden kunne ikke sendes da det indtastede tlf.<br>nummer ikke er et gyldigt mobil nummer!</font>\" End If
Set fsoSystem = Server.CreateObject(\"Scripting.FileSystemObject\") Set fsoFile = fsoSystem.OpenTextFile(Server.MapPath(strScriptName & \".log\"), 8, True) fsoFile.WriteLine \"At \" & Now & \" a message to \" & strNummer & \" (\" & Len(strBesked) & \" chars long) was sent by \" & strFra & \" (\" & Request.ServerVariables(\"REMOTE_ADDR\") & \")\" fsoFile.Close Set fsoFile = Nothing Set fsoSystem = Nothing
strBesked = \"\" strNummer = \"\" strFra = \"\" End If
End If %> <html> <head> <title>Send SMS</title> <script language=\"JavaScript\"> <!-- function showleft() { document.frmSms.count.value=800-(document.frmSms.besked.value.length+document.frmSms.fra.value.length); } function checklength() { if (document.frmSms.besked.value.length+document.frmSms.fra.value.length > 800) { alert(\"Din besked må max. være på 800 tegn!\"); document.frmSms.besked.focus(); return (false); } else if (document.frmSms.nummer.value.length !=8) { alert(\"Du skal skrive et gyldigt 8-cifret tlf. nummer!\"); document.frmSms.nummer.focus(); return (false); } else if (document.frmSms.fra.value.length == 0) { alert(\"Du skal skrive et afsender navn/tlf. nummer!\"); document.frmSms.fra.focus(); return (false); }
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.