SIM808 Email Sending

Status
Not open for further replies.

hothyfaalkhateeb

Newbie level 2
Joined
Oct 24, 2017
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
30
Hello there ...
I am trying to send an email via gprs using a sim808...
i always end up with an error
+SMTPSEND:61
+SMTPSEND:62
(Note I am using raspberry pi to control the Gs
This is my code Please Help!


Code - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
import serial
import RPi.GPIO as GPIO      
import os, time
 
GPIO.setmode(GPIO.BOARD)    
 
# Enable Serial Communication
port = serial.Serial("/dev/ttyS0", baudrate=115200, timeout=1)
 
# Transmitting AT Commands to the Modem
# '\r\n' indicates the Enter key
 
#port.write('AT'+'\r\n')
# WOW I FINALLY DID IT 
port.write(bytes('AT'+'\r\n','UTF-8'))
rcv = port.read(99)
print ("at %s" %rcv)
print ("\n")
 
 
time.sleep(1)
 
port.write(bytes('AT+SAPBR=3,1,"Contype","GPRS"'+'\r\n','UTF-8'))
rcv = port.read(99)
print ("contype %s" %rcv)
print ("\n")
 
 
time.sleep(1)
 
port.write(bytes('AT+SAPBR=3,1,"APN","zain"'+'\r\n','UTF-8'))
rcv = port.read(99)
print ("apn %s" %rcv)
print ("\n")
 
 
time.sleep(1)
 
port.write(bytes('AT+SAPBR =1,1'+'\r\n','UTF-8'))
rcv = port.read(99)
print ("gprs %s" %rcv)
print ("\n")
 
 
time.sleep(1)
 
 
port.write(bytes('AT+SAPBR=2,1'+'\r\n','UTF-8'))
rcv = port.read(99)
print ("query %s" %rcv)
print ("\n")
 
 
time.sleep(1)
     
 
 
 
 
   
 
port.write(bytes('AT+EMAILCID=1'+'\r\n','UTF-8'))
rcv = port.read(99)
print ("email pra %s" %rcv)
print ("\n")
 
 
time.sleep(1)  
 
 
 
port.write(bytes('AT+EMAILSSL=1'+'\r\n','UTF-8'))
rcv = port.read(99)
print ("praa 2 %s" %rcv)
print ("\n")
 
time.sleep(1)
 
                 
                 
port.write(bytes('AT+SMTPSRV="smtp.mail.yahoo.in",465'+'\r\n','UTF-8'))
rcv = port.read(99)
#print rcv
print ("email %s" %rcv)
print ("\n")
 
 
time.sleep(1)  
 
port.write(bytes('AT+SMTPAUTH=1,"xxxx@yahoo.in","xxxxxxx"'+'\r\n','UTF-8'))
rcv = port.read(99)
#print rcv
print ("email 2 %s" %rcv)
print ("\n")
 
 
time.sleep(1)
                 
 
port.write(bytes('AT+SMTPFROM="xxxx@yahoo.in","xxxxx"'+'\r\n','UTF-8'))
rcv = port.read(99)
print ("from %s" %rcv)
print ("\n")
 
 
time.sleep(1)
 
 
port.write(bytes('AT+SMTPRCPT=0,0,"xxxxx@hotmail.com","xxx"'+'\r\n','UTF-8'))
rcv = port.read(99)
#print rcv
print ("to %s" %rcv)
print ("\n")
 
 
time.sleep(1)
 
 
 
 
port.write(bytes('AT+SMTPSUB="CapBlack"'+'\r\n','UTF-8'))
rcv = port.read(99)
#print rcv
print ("%s" %rcv)
print ("\n")
 
 
time.sleep(1)
 
 
 
 
 
 
 
 
port.write(bytes('AT+SAPBR=0,1'+'\r\n','UTF-8'))
rcv = port.read(99)
#print rcv
print ("to %s" %rcv)
print ("\n")
 
 
 
time.sleep(1)
 
 
port.write(bytes('AT+SMTPSEND'+'\r\n','UTF-8'))
rcv = port.read(200)
#print rcv
print ("%s" %rcv)
print ("\n")
 
time.sleep(10)
 
 
                 
 
print("END OF DATA")
print ("\n")

 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…