Search code examples
androidtextvbscriptsmsatt

Reply to SMS in VBS


My question for you today is "How to reply to an email using windows vbscript." (Gmail) That may not be the best explanation...

WAIT, I already know how to SEND an email (to my phone through [email protected]) using VBScript, but I want to reply to a text. I have a system that alerts my phone when an action is performed on my computer (through VBScript) but this keeps happening. It's as if I receive the message from a different address each and every time.

So, is there any way to make it so I receive the text from the same recipient each time? Currently, the "phone" number of the sender started at 1410200500 and counts up every time I send it using this vbs code.

Const schema   = "http://schemas.microsoft.com/cdo/configuration/"
Const cdoBasic = 1
Const cdoSendUsingPort = 2

Set oMsg      = CreateObject("CDO.Message")
oMsg.From     = "[email protected]"
oMsg.To       = "[email protected]"
oMsg.TextBody = "ALERTMSG"

Set oConf = oMsg.Configuration
oConf.Fields(schema & "smtpserver")       = "smtp.gmail.com"
oConf.Fields(schema & "smtpserverport")   = 465
oConf.Fields(schema & "sendusing")        = cdoSendUsingPort
oConf.Fields(schema & "smtpauthenticate") = cdoBasic
oConf.Fields(schema & "smtpusessl")       = True
oConf.Fields(schema & "sendusername")     = "[email protected]"
oConf.Fields(schema & "sendpassword")     = "supersecretpassword"
oConf.Fields.Update

oMsg.Send

Everything works except for the issue of the sender being different each time.

Please help

Edit: I have found that this is unavoidable, thanks to everyone that helped!


Solution

  • There is nothing wrong with your VBScript or the CDO configuration.

    The value assigned to the Sender by the SMS Middleware that takes the e-mail and forwards it to an SMS service is outside your control. The only option you have is to contact your SMS provider but I wouldn't suggest they will change how this works.

    In fact in this Video at 0:40 it states;

    "the number that appears on your recipients phone or device may not be your actual phone number, but they will see the name, subject and e-mail address you used to send the text message."


    Useful Links