8 Messages
Sending an email from a script.
I should be able to use a blat command within a windows script to send an email? I get an error that says the smtp server does not like the user name.
Any help is appreciated. This appears to be a comcast issue.
Here is blat code
:: Gmail settings
set SMTP_SERVER=smtp.comcast.net
set SMTP_PORT=587
set FROM=user@comcast.net
set USERNAME=user@comcast.net
set PASSWORD=userpassword
set TO=email recipient
set SUBJECT="Current Log"
set BODY="This is the log from today"
set ATTACHMENT="D:\Backup.log"
:: Send the email using Blat
%BLAT_PATH%\blat.exe -f %FROM% -to %TO% -subject %SUBJECT% -body %BODY% -attach %ATTACHMENT% -server %SMTP_SERVER% -port %SMTP_PORT% >d:\backup.log
rem %BLAT_PATH%\blat.exe -to %TO% -subject %SUBJECT% -body %BODY% -attach %ATTACHMENT% -server %SMTP_SERVER% -port %SMTP_PORT% -f %FROM% -u %USERNAME% -pw %PASSWORD% >dbackup.log
Accepted Solution
BruceW
Gold Problem Solver
•
26.3K Messages
3 months ago
Are you using stunnel or a similar utility to encrypt Blat's data? Most mail servers, including Comcast's, require that connections be encrypted.
Please be aware that there are 2 kinds of responses in this Forum: Replies and Comments. When you Comment on a post by scrolling down to "Comment on this post here...", I am notified of your response. But if you select Reply, I am NOT notified and may not be aware of your response.
(edited)
0
EG
Expert
•
109.9K Messages
3 months ago
Concern moved here to the E-mail help section for assistance.
0
0
XfinityBenny
Official Employee
•
790 Messages
3 months ago
@user_y5eiri Thanks for adding a post. We recommend checking to make sure you can log in to your email and send messages from https://xfinityconnect.email.comcast.net/ successfully. Check out this https://www.xfinity.com/support/articles/limitations-on-sending-email guide on email limits, but also the very helpful articles on the right hand side to troubleshoot further. The advice from BruceW is also great, and also a good place to continue for the third party commands. Make sure you reply to their request for more info if needed, or confirm if that was the solution.
1
0
user_y5eiri
8 Messages
3 months ago
also tried putting quotes around the entries in script that had special characters such as password, email address, etc - no difference - still didn't like sender's name. SHould this not be an email address?
1
0
BruceW
Gold Problem Solver
•
26.3K Messages
3 months ago
The remmed out blat command line has "-u %USERNAME%" and "-pw %PASSWORD%" params, but the active line above it does not. Are these stored somewhere so blat can log in to the server?
ETA: Running the command with the -debug parameter might reveal more.
Please be aware that there are 2 kinds of responses in this Forum: Replies and Comments. When you Comment on a post by scrolling down to "Comment on this post here...", I am notified of your response. But if you select Reply, I am NOT notified and may not be aware of your response.
(edited)
2
0
user_y5eiri
8 Messages
2 months ago
I am still having trouble making this work - here is a summary of what I have done so far - this should be much easier but not sure why I am struggling so...thanks for any help you can supply.
Stunnel.conf contains
[comcast-smtp]
client = yes
accept = 127.0.0.1:2525
connect = smtp.comcast.net:587
verifyChain = yes
CAfile = ca-certs.pem
checkHost = smtp.comcast.net
OCSPaia = yes
also stunnel.pem has both a private and a certificate that were packaged with it
*********************************
my script modified: Please note I tried 587 instead of 2525 in both this script and the config file with results staying the same
set BLAT_PATH=D:\Bin\Blat\full
REM Set up email parameters
set SMTP_SERVER=127.0.0.1:2525
set FROM=me@comcast.net
set TO=myotheremail@gmail.com
set SUBJECT=Testme
set BODY=Test
set USERNAME=me@comcast.net
set PASSWORD="mypassword"
d:\Bin\Blat\full\blat -to %TO% -subject "%SUBJECT%" -body "%BODY%" -server %SMTP_SERVER% -f %FROM% -u %USERNAME% -pw %PASSWORD% >>E:\temp\email.log
********************************
Results of a run from e:\temp\email.log
Blat v3.2.24 (build : Feb 9 2022 21:19:39)
64-bit Windows, Full, Unicode
Error: Connection to server was dropped.
Error: Connection to server was dropped.
Error: Connection to server was dropped.
*** Error *** SMTP server error
Error: Not a socket.
Error: Not a socket.
1
0
user_y5eiri
8 Messages
2 months ago
Problem has been solved..............thanks to all involved
0