Bob Schneider
asked on
Sending CDO SMTP Mail via gmail
I need to convert my email send capabilities of my web site to use my gmail account. I could use some help modifying this code to work. Thanks!!
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "old.server"
.Item(cdoSMTPAuthenticate) = 1
.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Item(cdoSendUsername) = "your_mom"
.Item(cdoSendPassword) = "pwd"
.Update
End With
Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
.To = sEvntDirEmail
.From = sEmail
.Subject = sEventName & " Contact: " & sSubject
.TextBody = sMsg
.Send
End With
Set cdoMessage = Nothing
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
carrzkiss, I will look at it in the morning....heading to bed...your persistence is much appreciated!!!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
carzkiss, I got a "Transport can't connect to the server..." error. I even reset my password to ensure that I had that correct. Any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect! Thanks!! I will now spend the time to change all of my web code to reflect this. padas, thanks for the include idea. Here is my last question: I use includes for my headers, menus, etc. How can I stick an include inside a block of asp script????
ASKER
Excellent! Thanks!!
<%if something="else" then%>
<!--#include file="get.asp"-->
<%else%>
<!--#include file="it.asp"-->
<%end if%>
You cannot put it like this.
<%if something="else" then
<!--#include file="get.asp"-->
%>
So, do the first one set above, and you will be good to go.
(this is the way I do mine, I have as many as 100+ files per project, and everything is included, depending on Queries from the database (or) URL)
Have a good one.
Carrzkiss
<!--#include file="get.asp"-->
<%else%>
<!--#include file="it.asp"-->
<%end if%>
You cannot put it like this.
<%if something="else" then
<!--#include file="get.asp"-->
%>
So, do the first one set above, and you will be good to go.
(this is the way I do mine, I have as many as 100+ files per project, and everything is included, depending on Queries from the database (or) URL)
Have a good one.
Carrzkiss
ASKER
So if I have:
<%
lots
and
lots
of
lines
of
code
%>
I can break it anywhere to insert an include?
<%
lots
and
lots
>%
<!--#include file="get.asp"-->
<%
of
lines
of
code
%>
<%
lots
and
lots
of
lines
of
code
%>
I can break it anywhere to insert an include?
<%
lots
and
lots
>%
<!--#include file="get.asp"-->
<%
of
lines
of
code
%>
Absolutely!
Lets say that you have a page, and within that page, you have 1000 lines of code.
Database Connections.
Page Layout
exc...
You can do it like this.
(Lets just say that you are using tables, as this is 90% of my work, I am trying to convert over to DIV, however, it is a slow process)
With the above scenario, it first deals with a Querystring, to see which menu to show.
Then we look at Database records to see which content to show.
Then we also check the Database records, to see which ads to show which user.
It is that simple, and makes for really easy debugging.
You can find more example here
http://www.cffcs.com
Let me know if you need any more advice on this Dynamic Coding Subject.
I live for this type of projects :)
Carrzkiss
Lets say that you have a page, and within that page, you have 1000 lines of code.
Database Connections.
Page Layout
exc...
You can do it like this.
(Lets just say that you are using tables, as this is 90% of my work, I am trying to convert over to DIV, however, it is a slow process)
<table>
<tr>
<%if request.QueryString("Admin") then%>
<td>Admin Menu</td>
<%elseif request.QueryString("Admin") then%>
<td>Normal Menu</td>
<%end if%>
<%if rs("stack")="Even" then%>
<td>Your stacked content is here</td>
<%elseif rs("stack")="OffSet" then%>
<td>Your stacked content is going to fall off the face of the earth</td>
<%end if%>
<%if rs("Ads")="User1" then%>
<td>1st Right Ads</td>
<%elseif rs("Ads")="User2" then%>
<td>2nd Right Ads</td>
<%end if%>
</table>
With the above scenario, it first deals with a Querystring, to see which menu to show.
Then we look at Database records to see which content to show.
Then we also check the Database records, to see which ads to show which user.
It is that simple, and makes for really easy debugging.
You can find more example here
http://www.cffcs.com
Let me know if you need any more advice on this Dynamic Coding Subject.
I live for this type of projects :)
Carrzkiss
ASKER
Incredibly helpful! Thanks for going above and beyond on this one!!!
No problem.
I know sharing the Knowledge that I know, when I am able to.
I know sharing the Knowledge that I know, when I am able to.
I hope you guys are on the east coast - much too early! Good luck!
Yep, East coast for me.
Woke up at 3:30am, and laid back down around 8:00am, and just got back up about 30 minutes ago.
Woke up at 3:30am, and laid back down around 8:00am, and just got back up about 30 minutes ago.
Ha, I do that too.
ASKER
Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory.
Except I know it is not elsewhere in the page. Could it be from this portion of my global.asa page?
<!--
METADATA
TYPE="typelib"
UUID="CD000000-8B95-11D1-8
NAME="CDO for Windows 2000 Library"
-->
Here is my entire code:
Open in new window