Загрузка страницы

How To Send Bulk SMS From Excel With TWILIO + VBA [Free Template]

🚀 This tutorial will show you, how to send SMS messages directly from Microsoft Excel with TWILIO & VBA. In particular, we will be sending a POST request to the Twilio SMS API using VBA.

Download the workbook from the tutorial:
👉 https://pythonandvba.com/twilio-sms-sender
_________________________
👩‍💻 Full code from the video:
Sub SendSMS()

'Activate "Microsoft XML, v6.0" under Tools - References

Dim wb As Workbook
Dim ws As Worksheet

Set wb = ThisWorkbook
Set ws = wb.Worksheets("Sheet1")

'Authentication
ACCOUNTSID = ws.Range("C4").Value
AUTHTOKEN = ws.Range("C5").Value
FROM_NUMBER = "%2B" & ws.Range("C6").Value

'Get last row number
lastrow_b = ws.Cells(Rows.Count, 2).End(xlUp).Row
lastrow_d = ws.Cells(Rows.Count, 4).End(xlUp).Row

'Clear Status
If lastrow_d LESS_THAN_SYMBOL 8 Then
ws.Range("D9:D" & lastrow_d).ClearContents
End If

For i = 9 To lastrow_b

'Get receiver number & text from worksheet
toNumber = "%2B" & ws.Range("B" & i).Value
BodyText = ws.Range("C" & i).Value

'Use XML HTTP
Set Request = CreateObject("MSXML2.ServerXMLHTTP.6.0")

'Specify URL
Url = "https://api.twilio.com/2010-04-01/Accounts/" & ACCOUNTSID & "/Messages.json"

'Open Request
Request.Open "POST", Url, False, ACCOUNTSID, AUTHTOKEN

'Request Header
Request.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"

'Concatenate PostData
postData = "From=" & FROM_NUMBER & "&To=" & toNumber & "&Body=" & BodyText

'Send the PostData
Request.send postData

'Get response status code & text
status_response = "Status Code: " & Request.Status & " | Status Text: " & Request.responseText

'Return status to worksheet
ws.Range("D" & i).Value = Format(Now, "mm/dd/yyyy HH:mm:ss") & "| " & status_response

Next i

MsgBox "Done!"

End Sub

◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️
𝗖𝗢𝗡𝗡𝗘𝗖𝗧 𝗪𝗜𝗧𝗛 𝗠𝗘:
🌎 Website: https://pythonandvba.com
📝 GitHub: https://github.com/Sven-Bo
⭐ Discord: https://pythonandvba.com/discord
▶️ Subscribe: https://youtube.com/c/CodingIsFun?sub_confirmation=1

🎉 𝗙𝗥𝗘𝗘 𝗘𝘅𝗰𝗲𝗹 𝗔𝗱𝗱-𝗶𝗻 𝘁𝗼 𝗯𝗼𝗼𝘀𝘁 𝘆𝗼𝘂𝗿 𝗽𝗿𝗼𝗱𝘂𝗰𝘁𝗶𝘃𝗶𝘁𝘆
Get it here: https://pythonandvba.com/mytoolbelt

📚 𝗥𝗲𝘀𝗼𝘂𝗿𝗰𝗲𝘀 𝗳𝗼𝗿 𝗹𝗲𝗮𝗿𝗻𝗶𝗻𝗴 𝗩𝗕𝗔 & 𝗣𝘆𝘁𝗵𝗼𝗻
Check out my recommendations: https://pythonandvba.com/resources

☕ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲❓
If you want to support this channel, you can buy me a coffee here:
https://pythonandvba.com/coffee-donation

Видео How To Send Bulk SMS From Excel With TWILIO + VBA [Free Template] канала Coding Is Fun
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
29 мая 2021 г. 17:00:32
00:07:29
Яндекс.Метрика