I have found a "hidden" size limit in outgoing e-mails of 32768 bytes :) even
though I use smtp_sendmailxmem that is supposed to be used for large e-mails. I
guess a int is used somewhere along the way to hold the size. When I
exceed the
limit my e-mail is cut but still sent. I am using DC 10.64 and Rabbit
5000.
I use the default MAX_TCP_SOCKET_BUFFERS = 4 and it works fine with two web
servers (http and https), secure smtp e-mail and a ftp client at the same
time.
pob
________________________________
From: Steve Trigero
To: r...
Sent: Wed, September 8, 2010 1:48:12 AM
Subject: Re: [rabbit-semi] Re: SMTP Implementation
I found one problem. The SMTP library uses the TCP buffers defined by
MAX_TCP_SOCKET_BUFFERS.
I defined just enough buffers to handle all the tcp sockets that I allowed. So
when the smtp lib tried to
open a connection to the server there were no buffers available, so the
connection failed. My complaint is
that the SMTP manual says nothing about it requiring a tcp buffer. And none of
the smtp api functions
returns an error indicating the problem encountered. I had to enable
debugging
in the smtp and tcp libraries
and step through the entire process to figure it out. I shouldn't have to
do
that.
Be that as it may, I have another problem. I now connect, and the verbose
message says it sent my email,
(which I never get) and that's the last thing I hear from my program. I get
a
virtual watchdog timeout calling
smtp_mailtick(). It's a good bet that a pointer has run amouk. Is there a
size
limit to any of the buffers passed
to smtp_sendmail? The smtp manual doesn't give any buffer sizes. It just
says to
use smtp_sendmail for "short"
messages, and to use smtp_sendmailxmem for "moderately long" messages. But never
defines what is "short"
and what is "moderate." Does that mean I can decide for myself what those mean?
My message is 64-bytes,
and the subject is around 32-bytes. Are those short or moderate lengths?
I'm in the process of modifying smtp.lib so I can try to find where
it's getting
hung up. Any ideas on where I
should look?
Steve
________________________________
From: Steve Trigero
To: r...
Sent: Tue, September 7, 2010 3:05:10 PM
Subject: Re: [rabbit-semi] Re: SMTP Implementation
I switched to DC 9.62 to see if that would make a difference. There is a
difference, but it's not
a better difference.
This is what SMTP_VERBOSE produces:
to:bf93
from:bf93
subject:bfdc
message:1F94
SMTP: Opening to
A0A00B9:19
Error opening
socket.
The "to", "from", "subject", and "message" parameters appear to be pointers. And
I verified the content of those strings
in my code, so I'm sure if what's going on with verbose. But also
notice that
the mail port is 19. What the....?
I compiled my code "as is". There were no changes made to go to DC 9.62 from
9.25. My code doesn't set
the mail port, it uses the default port, which was supposed to be 25, as it was
with DC 9.25.
Also note that, because of all the discussion as to whether a "From" address was
required or not, I set the "From"
address to be the same as the "To" address. So "From" is set with a valid
address.
In any case, I see no improvement in going with DC 9.62. And one could make the
case that going to 9.62 is a
step backwards.
Steve
________________________________
From: Tom Collins
To: r...
Sent: Tue, September 7, 2010 6:30:28 AM
Subject: Re: [rabbit-semi] Re: SMTP Implementation
On Sep 7, 2010, at 5:12 AM, ebrains2003 wrote:
Make sure the server isn't one that requires POP3 before SMPT, in other
words,
they won't let you send an email until you first login and read emails (or
at
least check for new emails). This isnt' all that common, but if you happen
to be
on one of these servers, it can be tricky. I believe they log your IP address
and set a timer. Once you read an email, you have x number of minutes to send
emails from that IP address.
POP-before-SMTP is typically for supporting legacy clients. All SMTP
servers in
this day and age use authentication (SMTP AUTH) and it's probably the best
way
to go. Rabbit has supported SMTP AUTH since one of the early DC 9
releases.
You may also want to allow customers to configure the outbound SMTP port.
It
defaults to 25, but many servers will also accept email on port 587
(tcp/submission) as a way to get around ISPs that block direct connections to
port 25 (or what to force you to use their SMTP server).
Finally, Google's Gmail service requires that you use TLS (encryption) for
your
SMTP connections. Dynamic C just started supporting client-side TLS in a
recent
DC 10 release, and I believe it includes samples that demonstrate sending email
through a Gmail account.
I'd definitely follow ebrains2003's advice and provide a configuration
screen in
your app, with all of the fields you'd expect to see in an email client
like
Outlook.
-Tom
SMTP Implementation
Started by ●September 1, 2010
Reply by ●September 8, 20102010-09-08
Reply by ●September 8, 20102010-09-08
--- In r..., Steve Trigero wrote:
> But also notice that
> the mail port is 19. What the....?
Steve, that is in hex. 0x19 = 25.
> But also notice that
> the mail port is 19. What the....?
Steve, that is in hex. 0x19 = 25.
Reply by ●September 8, 20102010-09-08
On Sep 7, 2010, at 4:48 PM, Steve Trigero wrote:
> My complaint is
> that the SMTP manual says nothing about it requiring a tcp buffer. And none of the smtp api functions
> returns an error indicating the problem encountered.
Certainly a valid complaint about the manual not documenting the need for an additional TCP socket/buffer for use by the library, but if you check the documentation for smtp_mailtick, you'll see that it can return SMTP_NOSOCK if it can't open a network socket. There are other errors as well, but the sample doesn't demonstrate checking the final return value of smtp_mailtick().
> My message is 64-bytes, and the subject is around 32-bytes. Are those short or moderate lengths?
Sounds short to me... Another poster described the hard limit of 32KB (signed 16-bit integer).
> I'm in the process of modifying smtp.lib so I can try to find where it's getting hung up. Any ideas on where I
> should look?
Maybe set a breakpoint right after it prints the message saying the email was sent, and step through the code from that point. Or sprinkle printfs after that point to see how far it gets.
-Tom
>
> My complaint is
> that the SMTP manual says nothing about it requiring a tcp buffer. And none of the smtp api functions
> returns an error indicating the problem encountered.
Certainly a valid complaint about the manual not documenting the need for an additional TCP socket/buffer for use by the library, but if you check the documentation for smtp_mailtick, you'll see that it can return SMTP_NOSOCK if it can't open a network socket. There are other errors as well, but the sample doesn't demonstrate checking the final return value of smtp_mailtick().
> My message is 64-bytes, and the subject is around 32-bytes. Are those short or moderate lengths?
Sounds short to me... Another poster described the hard limit of 32KB (signed 16-bit integer).
> I'm in the process of modifying smtp.lib so I can try to find where it's getting hung up. Any ideas on where I
> should look?
Maybe set a breakpoint right after it prints the message saying the email was sent, and step through the code from that point. Or sprinkle printfs after that point to see how far it gets.
-Tom
>
Reply by ●September 8, 20102010-09-08
The 19 is actually in hex base, which is 25 decimal ;)It´s right. Does the
smtp server you are using to test does the connections on port 25 decimal? It
may be using another port. At this time, i really don´t know what´s
the problem there. I used this smtp thing on several products with no
issues at all.
--- Em ter, 7/9/10, Steve Trigero escreveu:
De: Steve Trigero
Assunto: Re: [rabbit-semi] Re: SMTP Implementation
Para: r...
Data: Terça-feira, 7 de Setembro de 2010, 19:05
I switched to DC 9.62 to see if that would make a difference. There is a difference, but it's not
a better difference.
This is what SMTP_VERBOSE produces:
to:bf93
from:bf93
subject:bfdc
message:1F94
SMTP: Opening to A0A00B9:19
Error opening
socket.
The "to", "from", "subject", and "message" parameters appear to be pointers. And I verified the content of those strings
in my code, so I'm sure if what's going on with verbose. But also notice that the mail port is 19. What the....?
I compiled my code "as is". There were no changes made to go to DC 9.62 from 9.25. My code doesn't set
the mail port, it uses the default port, which was supposed to be 25, as it was with DC 9.25.
Also note that, because of all the discussion as to whether a "From" address was required or not, I set the "From"
address to be the same as the "To" address. So "From" is set with a valid address.
In any case, I see no improvement in going with DC 9.62. And one could make the case that going to 9.62 is a
step backwards.
Steve
From: Tom Collins
To: r...
Sent: Tue, September 7, 2010 6:30:28 AM
Subject: Re: [rabbit-semi] Re: SMTP Implementation
On Sep 7, 2010, at 5:12 AM, ebrains2003 wrote:
Make sure the server isn't one that requires POP3 before SMPT, in other words, they won't let you send an email until you first login and read emails (or at least check for new emails). This isnt' all that common, but if you happen to be on one of these servers, it can be tricky. I believe they log your IP address and set a timer. Once you read an email, you have x number of minutes to send emails from that IP address.
POP-before-SMTP is typically for supporting legacy clients. All SMTP servers in this day and age use authentication (SMTP AUTH) and it's probably the best way to go. Rabbit has supported SMTP AUTH since one of the early DC 9 releases.
You may also want to allow customers to configure the outbound SMTP port. It defaults to 25, but many servers will also accept email on port 587 (tcp/submission) as a way to get around ISPs that block direct connections to port 25 (or what to force you to use their SMTP server).
Finally, Google's Gmail service requires that you use TLS (encryption) for your SMTP connections. Dynamic C just started supporting client-side TLS in a recent DC 10 release, and I believe it includes samples that demonstrate sending email through a Gmail account.
I'd definitely follow ebrains2003's advice and provide a configuration screen in your app, with all of the fields you'd expect to see in an email client like Outlook.
-Tom
--- Em ter, 7/9/10, Steve Trigero escreveu:
De: Steve Trigero
Assunto: Re: [rabbit-semi] Re: SMTP Implementation
Para: r...
Data: Terça-feira, 7 de Setembro de 2010, 19:05
I switched to DC 9.62 to see if that would make a difference. There is a difference, but it's not
a better difference.
This is what SMTP_VERBOSE produces:
to:bf93
from:bf93
subject:bfdc
message:1F94
SMTP: Opening to A0A00B9:19
Error opening
socket.
The "to", "from", "subject", and "message" parameters appear to be pointers. And I verified the content of those strings
in my code, so I'm sure if what's going on with verbose. But also notice that the mail port is 19. What the....?
I compiled my code "as is". There were no changes made to go to DC 9.62 from 9.25. My code doesn't set
the mail port, it uses the default port, which was supposed to be 25, as it was with DC 9.25.
Also note that, because of all the discussion as to whether a "From" address was required or not, I set the "From"
address to be the same as the "To" address. So "From" is set with a valid address.
In any case, I see no improvement in going with DC 9.62. And one could make the case that going to 9.62 is a
step backwards.
Steve
From: Tom Collins
To: r...
Sent: Tue, September 7, 2010 6:30:28 AM
Subject: Re: [rabbit-semi] Re: SMTP Implementation
On Sep 7, 2010, at 5:12 AM, ebrains2003 wrote:
Make sure the server isn't one that requires POP3 before SMPT, in other words, they won't let you send an email until you first login and read emails (or at least check for new emails). This isnt' all that common, but if you happen to be on one of these servers, it can be tricky. I believe they log your IP address and set a timer. Once you read an email, you have x number of minutes to send emails from that IP address.
POP-before-SMTP is typically for supporting legacy clients. All SMTP servers in this day and age use authentication (SMTP AUTH) and it's probably the best way to go. Rabbit has supported SMTP AUTH since one of the early DC 9 releases.
You may also want to allow customers to configure the outbound SMTP port. It defaults to 25, but many servers will also accept email on port 587 (tcp/submission) as a way to get around ISPs that block direct connections to port 25 (or what to force you to use their SMTP server).
Finally, Google's Gmail service requires that you use TLS (encryption) for your SMTP connections. Dynamic C just started supporting client-side TLS in a recent DC 10 release, and I believe it includes samples that demonstrate sending email through a Gmail account.
I'd definitely follow ebrains2003's advice and provide a configuration screen in your app, with all of the fields you'd expect to see in an email client like Outlook.
-Tom
Reply by ●September 8, 20102010-09-08
I solved the Virtual Watchdog Timeout by adding a watchdog reset to my loop:
smtp_sendmail( email_adrs, email_adrs , id_string, buf );
errCode = smtp_mailtick();
while ( errCode == SMTP_PENDING ) {
errCode = smtp_mailtick();
ScratchDog();
}
With the watchdog taken care of, it still doesn't work.
So I found the following statement in SMTP.LIB.:
printf("SMTP: Wrote %*.*s",rc, rc, buffer);
That statement looks funny to me. The format statements don't match the number
of
arguments passed. So I replaced it with my own:
printf("SMTP: Wrote %d bytes, %s",rc, buffer);
This is the verbose printout:
SMTP: Opening to 0A0A00B9:25
SMTP: Connected
SMTP: Read: 220 CMDCEXCAHT01.comtechtel.com Microsoft ESMTP MAIL Service ready a
t Wed, 8 Sep 2010 11:21:48 -0400
SMTP: Wrote 18 bytes, HELO 10.250.5.51
SMTP: Read: 250 CMDCEXCAHT01.comtechtel.com Hello [10.250.5.51]
SMTP: Wrote 42 bytes, MAIL FROM:
What I think this is telling me is that my original email message is not being
sent.
Next I added more printf() statements to track the path through the library. In
function smtp_mailtick()
there is a very large switch statement. So I added a printf() statement at the
beginning of each case
identifying the case. This is printout:
SMTP: Case SMTP_INIT
SMTP: Opening to 0A0A00B9:25
SMTP: Case SMTP_WAITFORESTAB
SMTP: Case SMTP_WAITFORESTAB
SMTP: Case SMTP_WAITFORESTAB
SMTP: Case SMTP_WAITFORESTAB
SMTP: Case SMTP_WAITFORESTAB
SMTP: Case SMTP_WAITFORESTAB
SMTP: Case SMTP_WAITFORESTAB
SMTP: Case SMTP_WAITFORESTAB
SMTP: Connected
SMTP: Case SMTP_WAITFORHELO220
SMTP: Case SMTP_WAITFORHELO220
SMTP: Case SMTP_WAITFORHELO220
SMTP: Case SMTP_WAITFORHELO220
SMTP: Read: 220 CMDCEXCAHT01.comtechtel.com Microsoft ESMTP MAIL Service ready a
t Wed, 8 Sep 2010 11:45:08 -0400
SMTP: Wrote 18 bytes, HELO 10.250.5.51
SMTP: Case SMTP_WAITFORMAIL250
SMTP: Case SMTP_WAITFORMAIL250
SMTP: Case SMTP_WAITFORMAIL250
SMTP: Case SMTP_WAITFORMAIL250
SMTP: Case SMTP_WAITFORMAIL250
SMTP: Read: 250 CMDCEXCAHT01.comtechtel.com Hello [10.250.5.51]
SMTP: Wrote 42 bytes, MAIL FROM:
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Case SMTP_WAITFORRCPT250
...
several hundred more Case SMTP_WAITFORRCPT250 statements...
...
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Read: 53ॠ€7.1 Client was not authenticated
SMTP: Case SMTP_DONE/ERROR: 14
The last two cases execute the same code, which seems odd to me, since one
case is DONE and the other case is ERROR. The number 14 in the printout is
the value of the case, which is SMTP_ERROR.
So, does all this mean that it's telling me I need to use Authentication?
Steve
________________________________
From: Tom Collins
To: r...
Sent: Wed, September 8, 2010 9:04:22 AM
Subject: Re: [rabbit-semi] Re: SMTP Implementation
On Sep 7, 2010, at 4:48 PM, Steve Trigero wrote:
>My complaint is
>that the SMTP manual says nothing about it requiring a tcp buffer. And none of
>the smtp api functions
>returns an error indicating the problem encountered.
Certainly a valid complaint about the manual not documenting the need for an
additional TCP socket/buffer for use by the library, but if you check the
documentation for smtp_mailtick, you'll see that it can return SMTP_NOSOCK if it
can't open a network socket. There are other errors as well, but the sample
doesn't demonstrate checking the final return value of smtp_mailtick().
My message is 64-bytes, and the subject is around 32-bytes. Are those short or
moderate lengths?
Sounds short to me... Another poster described the hard limit of 32KB (signed
16-bit integer).
I'm in the process of modifying smtp.lib so I can try to find where it's getting
hung up. Any ideas on where I
>should look?
Maybe set a breakpoint right after it prints the message saying the email was
sent, and step through the code from that point. Or sprinkle printfs after that
point to see how far it gets.
-Tom
smtp_sendmail( email_adrs, email_adrs , id_string, buf );
errCode = smtp_mailtick();
while ( errCode == SMTP_PENDING ) {
errCode = smtp_mailtick();
ScratchDog();
}
With the watchdog taken care of, it still doesn't work.
So I found the following statement in SMTP.LIB.:
printf("SMTP: Wrote %*.*s",rc, rc, buffer);
That statement looks funny to me. The format statements don't match the number
of
arguments passed. So I replaced it with my own:
printf("SMTP: Wrote %d bytes, %s",rc, buffer);
This is the verbose printout:
SMTP: Opening to 0A0A00B9:25
SMTP: Connected
SMTP: Read: 220 CMDCEXCAHT01.comtechtel.com Microsoft ESMTP MAIL Service ready a
t Wed, 8 Sep 2010 11:21:48 -0400
SMTP: Wrote 18 bytes, HELO 10.250.5.51
SMTP: Read: 250 CMDCEXCAHT01.comtechtel.com Hello [10.250.5.51]
SMTP: Wrote 42 bytes, MAIL FROM:
What I think this is telling me is that my original email message is not being
sent.
Next I added more printf() statements to track the path through the library. In
function smtp_mailtick()
there is a very large switch statement. So I added a printf() statement at the
beginning of each case
identifying the case. This is printout:
SMTP: Case SMTP_INIT
SMTP: Opening to 0A0A00B9:25
SMTP: Case SMTP_WAITFORESTAB
SMTP: Case SMTP_WAITFORESTAB
SMTP: Case SMTP_WAITFORESTAB
SMTP: Case SMTP_WAITFORESTAB
SMTP: Case SMTP_WAITFORESTAB
SMTP: Case SMTP_WAITFORESTAB
SMTP: Case SMTP_WAITFORESTAB
SMTP: Case SMTP_WAITFORESTAB
SMTP: Connected
SMTP: Case SMTP_WAITFORHELO220
SMTP: Case SMTP_WAITFORHELO220
SMTP: Case SMTP_WAITFORHELO220
SMTP: Case SMTP_WAITFORHELO220
SMTP: Read: 220 CMDCEXCAHT01.comtechtel.com Microsoft ESMTP MAIL Service ready a
t Wed, 8 Sep 2010 11:45:08 -0400
SMTP: Wrote 18 bytes, HELO 10.250.5.51
SMTP: Case SMTP_WAITFORMAIL250
SMTP: Case SMTP_WAITFORMAIL250
SMTP: Case SMTP_WAITFORMAIL250
SMTP: Case SMTP_WAITFORMAIL250
SMTP: Case SMTP_WAITFORMAIL250
SMTP: Read: 250 CMDCEXCAHT01.comtechtel.com Hello [10.250.5.51]
SMTP: Wrote 42 bytes, MAIL FROM:
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Case SMTP_WAITFORRCPT250
...
several hundred more Case SMTP_WAITFORRCPT250 statements...
...
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Read: 53ॠ€7.1 Client was not authenticated
SMTP: Case SMTP_DONE/ERROR: 14
The last two cases execute the same code, which seems odd to me, since one
case is DONE and the other case is ERROR. The number 14 in the printout is
the value of the case, which is SMTP_ERROR.
So, does all this mean that it's telling me I need to use Authentication?
Steve
________________________________
From: Tom Collins
To: r...
Sent: Wed, September 8, 2010 9:04:22 AM
Subject: Re: [rabbit-semi] Re: SMTP Implementation
On Sep 7, 2010, at 4:48 PM, Steve Trigero wrote:
>My complaint is
>that the SMTP manual says nothing about it requiring a tcp buffer. And none of
>the smtp api functions
>returns an error indicating the problem encountered.
Certainly a valid complaint about the manual not documenting the need for an
additional TCP socket/buffer for use by the library, but if you check the
documentation for smtp_mailtick, you'll see that it can return SMTP_NOSOCK if it
can't open a network socket. There are other errors as well, but the sample
doesn't demonstrate checking the final return value of smtp_mailtick().
My message is 64-bytes, and the subject is around 32-bytes. Are those short or
moderate lengths?
Sounds short to me... Another poster described the hard limit of 32KB (signed
16-bit integer).
I'm in the process of modifying smtp.lib so I can try to find where it's getting
hung up. Any ideas on where I
>should look?
Maybe set a breakpoint right after it prints the message saying the email was
sent, and step through the code from that point. Or sprinkle printfs after that
point to see how far it gets.
-Tom
Reply by ●September 8, 20102010-09-08
> So, does all this mean that it's telling me
I need to use Authentication?
>
> Steve
Sure looks that way. This is the email routine I used. It has worked very well and I had USE_SMTP_AUTH defined to enable authorization. I believe I was using DC 9.25 back then:
int HandleEmail(void)
{
// smtp_setauth("u...@domain.com", "password");
#ifdef USE_SMTP_AUTH
smtp_setauth (EmailFrom, EmailPass);
#endif
smtp_sendmail(EmailAddress, EmailFrom, subject, body);
while(smtp_mailtick()==SMTP_PENDING)
continue;
if(smtp_status()==SMTP_SUCCESS)
{
#ifdef IPIO_DEBUG
printf("Message sent\n");
#endif
PorteOn(STAT_GREEN);
PorteOff(STAT_RED);
return 1;// 1 indicates success
}
else
{
#ifdef IPIO_DEBUG
printf("Error sending message\n");
#endif
PorteOn(STAT_RED);
PorteOff(STAT_GREEN);
// PortaOn(EMAIL_RED);
return 0;// 0 indicates an error
}
}
>
> Steve
Sure looks that way. This is the email routine I used. It has worked very well and I had USE_SMTP_AUTH defined to enable authorization. I believe I was using DC 9.25 back then:
int HandleEmail(void)
{
// smtp_setauth("u...@domain.com", "password");
#ifdef USE_SMTP_AUTH
smtp_setauth (EmailFrom, EmailPass);
#endif
smtp_sendmail(EmailAddress, EmailFrom, subject, body);
while(smtp_mailtick()==SMTP_PENDING)
continue;
if(smtp_status()==SMTP_SUCCESS)
{
#ifdef IPIO_DEBUG
printf("Message sent\n");
#endif
PorteOn(STAT_GREEN);
PorteOff(STAT_RED);
return 1;// 1 indicates success
}
else
{
#ifdef IPIO_DEBUG
printf("Error sending message\n");
#endif
PorteOn(STAT_RED);
PorteOff(STAT_GREEN);
// PortaOn(EMAIL_RED);
return 0;// 0 indicates an error
}
}
Reply by ●September 8, 20102010-09-08
2 questions:
1. Is the "username" argument of smtp_setauth() supposed to be an email address
as opposed to a login/ID name?
2. Are you supposed to call smtp_setauth() everytime you need to send an email?
In other words, can I call it
just once at initialization?
Steve
________________________________
From: ebrains2003
To: r...
Sent: Wed, September 8, 2010 11:52:19 AM
Subject: [rabbit-semi] Re: SMTP Implementation
> So, does all this mean that it's telling me I need to use Authentication?
> Â
> Steve
Sure looks that way. This is the email routine I used. It has worked very well
and I had USE_SMTP_AUTH defined to enable authorization. I believe I was using
DC 9.25 back then:
int HandleEmail(void)
{
// smtp_setauth("u...@domain.com", "password");
#ifdef USE_SMTP_AUTH
smtp_setauth (EmailFrom, EmailPass);
#endif
smtp_sendmail(EmailAddress, EmailFrom, subject, body);
while(smtp_mailtick()==SMTP_PENDING)
continue;
if(smtp_status()==SMTP_SUCCESS)
{
#ifdef IPIO_DEBUG
printf("Message sent\n");
#endif
PorteOn(STAT_GREEN);
PorteOff(STAT_RED);
return 1;// 1 indicates success
}
else
{
#ifdef IPIO_DEBUG
printf("Error sending message\n");
#endif
PorteOn(STAT_RED);
PorteOff(STAT_GREEN);
// PortaOn(EMAIL_RED);
return 0;// 0 indicates an error
}
}
1. Is the "username" argument of smtp_setauth() supposed to be an email address
as opposed to a login/ID name?
2. Are you supposed to call smtp_setauth() everytime you need to send an email?
In other words, can I call it
just once at initialization?
Steve
________________________________
From: ebrains2003
To: r...
Sent: Wed, September 8, 2010 11:52:19 AM
Subject: [rabbit-semi] Re: SMTP Implementation
> So, does all this mean that it's telling me I need to use Authentication?
> Â
> Steve
Sure looks that way. This is the email routine I used. It has worked very well
and I had USE_SMTP_AUTH defined to enable authorization. I believe I was using
DC 9.25 back then:
int HandleEmail(void)
{
// smtp_setauth("u...@domain.com", "password");
#ifdef USE_SMTP_AUTH
smtp_setauth (EmailFrom, EmailPass);
#endif
smtp_sendmail(EmailAddress, EmailFrom, subject, body);
while(smtp_mailtick()==SMTP_PENDING)
continue;
if(smtp_status()==SMTP_SUCCESS)
{
#ifdef IPIO_DEBUG
printf("Message sent\n");
#endif
PorteOn(STAT_GREEN);
PorteOff(STAT_RED);
return 1;// 1 indicates success
}
else
{
#ifdef IPIO_DEBUG
printf("Error sending message\n");
#endif
PorteOn(STAT_RED);
PorteOff(STAT_GREEN);
// PortaOn(EMAIL_RED);
return 0;// 0 indicates an error
}
}
Reply by ●September 8, 20102010-09-08
> 2 questions:
>
> 1. Is the "username" argument of smtp_setauth() supposed to be an email address
> as opposed to a login/ID name?
That may depend on the email server. Mine requires a full email address for a username.
> 2. Are you supposed to call smtp_setauth() everytime you need to send an email?
> In other words, can I call it
> just once at initialization?
I made it part of the function, so it was always called in my program. I guess you could try calling it just once, but what is the harm in calling it each time? I had up to two email users that could be emailed by this particular product, so it needed to be set those fields each time.
>
> 1. Is the "username" argument of smtp_setauth() supposed to be an email address
> as opposed to a login/ID name?
That may depend on the email server. Mine requires a full email address for a username.
> 2. Are you supposed to call smtp_setauth() everytime you need to send an email?
> In other words, can I call it
> just once at initialization?
I made it part of the function, so it was always called in my program. I guess you could try calling it just once, but what is the harm in calling it each time? I had up to two email users that could be emailed by this particular product, so it needed to be set those fields each time.
Reply by ●September 8, 20102010-09-08
I use gmail.com and use my emai address to login.
I only call smtp_setauth() once at init.
pob
________________________________
From: Steve Trigero
To: r...
Sent: Wed, September 8, 2010 9:52:51 PM
Subject: Re: [rabbit-semi] Re: SMTP Implementation
2 questions:
1. Is the "username" argument of smtp_setauth() supposed to be an email address
as opposed to a login/ID name?
2. Are you supposed to call smtp_setauth() everytime you need to send an email?
In other words, can I call it
just once at initialization?
Steve
________________________________
From: ebrains2003
To: r...
Sent: Wed, September 8, 2010 11:52:19 AM
Subject: [rabbit-semi] Re: SMTP Implementation
> So, does all this mean that it's telling me I need to use Authentication?
> Â
> Steve
Sure looks that way. This is the email routine I used. It has worked very well
and I had USE_SMTP_AUTH defined to enable authorization. I believe I was using
DC 9.25 back then:
int HandleEmail(void)
{
// smtp_setauth("u...@domain.com", "password");
#ifdef USE_SMTP_AUTH
smtp_setauth (EmailFrom, EmailPass);
#endif
smtp_sendmail(EmailAddress, EmailFrom, subject, body);
while(smtp_mailtick()==SMTP_PENDING)
continue;
if(smtp_status()==SMTP_SUCCESS)
{
#ifdef IPIO_DEBUG
printf("Message sent\n");
#endif
PorteOn(STAT_GREEN);
PorteOff(STAT_RED);
return 1;// 1 indicates success
}
else
{
#ifdef IPIO_DEBUG
printf("Error sending message\n");
#endif
PorteOn(STAT_RED);
PorteOff(STAT_GREEN);
// PortaOn(EMAIL_RED);
return 0;// 0 indicates an error
}
}
I only call smtp_setauth() once at init.
pob
________________________________
From: Steve Trigero
To: r...
Sent: Wed, September 8, 2010 9:52:51 PM
Subject: Re: [rabbit-semi] Re: SMTP Implementation
2 questions:
1. Is the "username" argument of smtp_setauth() supposed to be an email address
as opposed to a login/ID name?
2. Are you supposed to call smtp_setauth() everytime you need to send an email?
In other words, can I call it
just once at initialization?
Steve
________________________________
From: ebrains2003
To: r...
Sent: Wed, September 8, 2010 11:52:19 AM
Subject: [rabbit-semi] Re: SMTP Implementation
> So, does all this mean that it's telling me I need to use Authentication?
> Â
> Steve
Sure looks that way. This is the email routine I used. It has worked very well
and I had USE_SMTP_AUTH defined to enable authorization. I believe I was using
DC 9.25 back then:
int HandleEmail(void)
{
// smtp_setauth("u...@domain.com", "password");
#ifdef USE_SMTP_AUTH
smtp_setauth (EmailFrom, EmailPass);
#endif
smtp_sendmail(EmailAddress, EmailFrom, subject, body);
while(smtp_mailtick()==SMTP_PENDING)
continue;
if(smtp_status()==SMTP_SUCCESS)
{
#ifdef IPIO_DEBUG
printf("Message sent\n");
#endif
PorteOn(STAT_GREEN);
PorteOff(STAT_RED);
return 1;// 1 indicates success
}
else
{
#ifdef IPIO_DEBUG
printf("Error sending message\n");
#endif
PorteOn(STAT_RED);
PorteOff(STAT_GREEN);
// PortaOn(EMAIL_RED);
return 0;// 0 indicates an error
}
}
Reply by ●September 21, 20102010-09-21
Ok, I'm back on this issue again. I added authorization, and
smtp_setauth()
returns
with no error. Yet I am still unable to send an email. I keep getting
SMTP_UNEXPECTED
error.
The verbose SMTP printout follows. Is there a clue here about what I am doing
wrong?
(the "case" lines are my added printf statements in the state machine in
smtp_mailtick())
SMTP: Case SMTP_PARSE_EHLO
SMTP: Case SMTP_PARSE_EHLO
SMTP: Case SMTP_PARSE_EHLO
SMTP: Case SMTP_PARSE_EHLO
SMTP: Case SMTP_PARSE_EHLO
SMTP: Case SMTP_PARSE_EHLO
SMTP: Case SMTP_PARSE_EHLO
SMTP: Read: 25à¥
SMTP: Case SMTP_SEND_AUTH
SMTP: Case SMTP_WAIT_CHALLENGE
SMTP: Read: 250-SIZE
SMTP: Wrote 42 bytes, 250-SIZE
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Read: 250-PIPELINING
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Read: 250-DSN
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Read: 250-ENHANCEDSTATUSCODES
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Read: 250-STARTTLS
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Read: 250-X-ANONYMOUSTLS
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Read: 250-AUTH NTLM
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Read: 250-X-EXPS GSSAPI NTLM
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Read: 250-8BITMIME
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Case SMTP_WAITFORRCPT250
...
SMTP: Read:
SMTP: Case SMTP_DONE/ERROR: 14
SMTP: Socket unexpectedly closed!
________________________________
From: Steve Trigero
To: r...
Sent: Wed, September 8, 2010 12:52:51 PM
Subject: Re: [rabbit-semi] Re: SMTP Implementation
2 questions:
1. Is the "username" argument of smtp_setauth() supposed to be an email address
as opposed to a login/ID name?
2. Are you supposed to call smtp_setauth() everytime you need to send an email?
In other words, can I call it
just once at initialization?
Steve
________________________________
From: ebrains2003
To: r...
Sent: Wed, September 8, 2010 11:52:19 AM
Subject: [rabbit-semi] Re: SMTP Implementation
> So, does all this mean that it's telling me I need to use Authentication?
> Â
> Steve
Sure looks that way. This is the email routine I used. It has worked very well
and I had USE_SMTP_AUTH defined to enable authorization. I believe I was using
DC 9.25 back then:
int HandleEmail(void)
{
// smtp_setauth("u...@domain.com", "password");
#ifdef USE_SMTP_AUTH
smtp_setauth (EmailFrom, EmailPass);
#endif
smtp_sendmail(EmailAddress, EmailFrom, subject, body);
while(smtp_mailtick()==SMTP_PENDING)
continue;
if(smtp_status()==SMTP_SUCCESS)
{
#ifdef IPIO_DEBUG
printf("Message sent\n");
#endif
PorteOn(STAT_GREEN);
PorteOff(STAT_RED);
return 1;// 1 indicates success
}
else
{
#ifdef IPIO_DEBUG
printf("Error sending message\n");
#endif
PorteOn(STAT_RED);
PorteOff(STAT_GREEN);
// PortaOn(EMAIL_RED);
return 0;// 0 indicates an error
}
}
returns
with no error. Yet I am still unable to send an email. I keep getting
SMTP_UNEXPECTED
error.
The verbose SMTP printout follows. Is there a clue here about what I am doing
wrong?
(the "case" lines are my added printf statements in the state machine in
smtp_mailtick())
SMTP: Case SMTP_PARSE_EHLO
SMTP: Case SMTP_PARSE_EHLO
SMTP: Case SMTP_PARSE_EHLO
SMTP: Case SMTP_PARSE_EHLO
SMTP: Case SMTP_PARSE_EHLO
SMTP: Case SMTP_PARSE_EHLO
SMTP: Case SMTP_PARSE_EHLO
SMTP: Read: 25à¥
SMTP: Case SMTP_SEND_AUTH
SMTP: Case SMTP_WAIT_CHALLENGE
SMTP: Read: 250-SIZE
SMTP: Wrote 42 bytes, 250-SIZE
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Read: 250-PIPELINING
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Read: 250-DSN
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Read: 250-ENHANCEDSTATUSCODES
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Read: 250-STARTTLS
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Read: 250-X-ANONYMOUSTLS
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Read: 250-AUTH NTLM
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Read: 250-X-EXPS GSSAPI NTLM
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Read: 250-8BITMIME
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Case SMTP_WAITFORRCPT250
SMTP: Case SMTP_WAITFORRCPT250
...
SMTP: Read:
SMTP: Case SMTP_DONE/ERROR: 14
SMTP: Socket unexpectedly closed!
________________________________
From: Steve Trigero
To: r...
Sent: Wed, September 8, 2010 12:52:51 PM
Subject: Re: [rabbit-semi] Re: SMTP Implementation
2 questions:
1. Is the "username" argument of smtp_setauth() supposed to be an email address
as opposed to a login/ID name?
2. Are you supposed to call smtp_setauth() everytime you need to send an email?
In other words, can I call it
just once at initialization?
Steve
________________________________
From: ebrains2003
To: r...
Sent: Wed, September 8, 2010 11:52:19 AM
Subject: [rabbit-semi] Re: SMTP Implementation
> So, does all this mean that it's telling me I need to use Authentication?
> Â
> Steve
Sure looks that way. This is the email routine I used. It has worked very well
and I had USE_SMTP_AUTH defined to enable authorization. I believe I was using
DC 9.25 back then:
int HandleEmail(void)
{
// smtp_setauth("u...@domain.com", "password");
#ifdef USE_SMTP_AUTH
smtp_setauth (EmailFrom, EmailPass);
#endif
smtp_sendmail(EmailAddress, EmailFrom, subject, body);
while(smtp_mailtick()==SMTP_PENDING)
continue;
if(smtp_status()==SMTP_SUCCESS)
{
#ifdef IPIO_DEBUG
printf("Message sent\n");
#endif
PorteOn(STAT_GREEN);
PorteOff(STAT_RED);
return 1;// 1 indicates success
}
else
{
#ifdef IPIO_DEBUG
printf("Error sending message\n");
#endif
PorteOn(STAT_RED);
PorteOff(STAT_GREEN);
// PortaOn(EMAIL_RED);
return 0;// 0 indicates an error
}
}