Jump to content

Sending Email


Recommended Posts

I would like my program to send an email to a certain address (myphone@cingularme.com) to text my phone.

I have checked and emailing does send a text message.

One problem I have is making my script log in to send the message.

I use MSN hotmail. (hotmail.com) will work fine. (or whatever I can use to log in to send messages)

I have searched the forums, but I don't know hotmail's SMTP (What is that?) server.

Any help is appreciated! muttley

My ProgramsMy WIP'sSteam Server Restarter
Link to comment
Share on other sites

THANK YOU SO MUCH!!

I signed up for free account and it worked muttley

now how do I incorporate it into my script?

Cool, that example in there, shows you all what you need. Not sure where you want to implement it, or how for that matter, so your code is necessary.
Link to comment
Share on other sites

Cool, that example in there, shows you all what you need. Not sure where you want to implement it, or how for that matter, so your code is necessary.

Yeah, I can show you the code. It's not nearly done, but I'll try my best to explain.

CODE
#include <GUIConstants.au3>

;--------------------------------------------------------------------------------

HotKeySet( "{ESC}", "_Exit")

;--------------------------------------------------------------------------------

$State = "Stopped" ;Whether or not the program is monitoring the server

$msg = ""

;--------------------------------------------------------------------------------

GUICreate( "Server Watrcher - By David L.", 205, 110) ;Created the GUI

$Monitor = Guictrlcreatebutton( "Start Monitoring", 10, 10)

$Stop = GUICtrlCreateButton( "Stop Monitoring", 110, 10)

$Label = GUICtrlCreateLabel( $State, 10, 50)

$SMS = GUICtrlCreateCheckbox( "Send Text Message with",10, 70)

$SMS2 = GUICtrlCreateLabel("server change in status?",27, 90)

Guisetstate() ;Set the GUI information

;--------------------------------------------------------------------------------

While $msg <> $GUI_EVENT_CLOSE ;Test to see if they tried to hit the X

$msg = GUIGetMsg()

Select

Case $msg = $Monitor ;They hit the monitor button

$State = "Monitoring"

GUICtrlSetData( $Label, $State)

Case $msg = $Stop ;They want to stop monitoring

GUICtrlSetData( $Label, $State)

$State = "Stopped"

Case $msg = $GUI_EVENT_CLOSE ;Exited using X

Exit

EndSelect

If $State = "Monitoring" Then ;Check to see if program should monitor

GUICtrlSetState($Monitor, $GUI_DISABLE) ;Disable the monitor button

GUICtrlSetData( $Label, $State) ;Change the label telling them what the program is doing

While $State = "Monitoring" ;A loop to wait until they Stop or Exit

;If WinExists( "Application Error") And Sleep(1000) ;Check every Minute Then ;Check to see if it encountered an error

;_RestartServer();lets restart the server

;$inputsms=GUICtrlRead($SMS)

;If $inputsms = $GUI_CHECKED Then

;_SendSMS ;If enabled, send email to users phone to tell them the status

;EndIf

$msg = GUIGetMsg()

Select

Case $msg = $Stop ;Hit stop

$State = "Stopped"

GUICtrlSetData( $Label, $State)

Case $msg = $GUI_EVENT_CLOSE ;Exited

Exit

EndSelect

WEnd

GUICtrlSetState($Monitor, $GUI_ENABLE)

EndIf

WEnd

;--------------------------------------------------------------------------------

Func _Exit()

Exit

EndFunc

Edited by Coolw
My ProgramsMy WIP'sSteam Server Restarter
Link to comment
Share on other sites

Try something like:

If $inputsms = $GUI_CHECKED Then
    $rc = _INetSmtpMailCom ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, $s_AttachFiles, $s_CcAddress, $s_BccAddress, $s_Username, $s_Password, $IPPort, $ssl)
    If @error Then
        MsgBox(0, "Error sending message", "Error code:" & @error & "  Rc:" & $rc)
    EndIf
EndIf

Cheers,

Brett

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...