Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

embed logo in autoemail 2

Status
Not open for further replies.

foxup

Programmer
Dec 14, 2010
328
CA
Hi All,

I would need some quick help please. I would like to 'embed' my company logo in the "auto-email" that gets sent out to our monthly recipients. Here is my code/program to send out an auto-email. How to modify it so that I can add my logo?


Local iMsg,iConf
Declare SHORT InternetGetConnectedState In wininet.Dll;
INTEGER @lpdwFlags, Integer dwReserved
lConnect=displayState()
If lConnect
iMsg = Createobject("CDO.Message")
iConf = Createobject("CDO.Configuration")
Flds = iConf.Fields
With Flds
.Item(" = 2
.Item(" = '??.???.???.???' &&server addy
.Item(" = 25
.Update()
Endwith
With iMsg
.Configuration = iConf
.To = m.emal
.BCC = ""
.From = "my@email.com"
.Subject = "blah blah"
.Fields("Priority").Value = 0 && -1=Low, 0=Normal, 1=High
.Fields.Update()
.HTMLBody = "body blah blah"
.Send()
Endwith
iMsg = .Null.
iConf = .Null.
Flds = .Null.
Else
Messagebox("Could not send the message, your internet connection is down.")
Endif
Procedure displayState
Local lConnected
lConnected = .F.
lpdwFlags = 0
If InternetGetConnectedState (@lpdwFlags, 0) = 1
lConnected = .T.
Endif
Return lConnected
Endproc



Any help would be great please.


Thank You,
FOXUP!
 
.HTMLBody = "body blah blah"

That tells me that you are sending your email body as an HTML document.

With HTML documents you generally have to reference image sources from somewhere that is accessible across the web.

Example:
Code:
<img src="smiley.gif" alt="Smiley face" height="42" width="42">

Does your company logo file exist somewhere such that it is accessible across the web?

Good Luck,
JRB-Bldr



 
yes it exists on our website. why?
 
With HTML documents you generally have to reference image sources from somewhere that is accessible across the web.

Agreed. But one possible problem: some spam filters might be suspicious of external links within messages where the target isn't visible to the user. I'm not sure how much of an issue that would be, but it's worth keeping in mind.

I found another possible solution here:

The code is in VB, but it looks easy to translate to VFP.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Alternatively the logo image file could be Attached or Embedded in the email itself.

When a recipient opens an email with an image in it, the email client application (Outlook, Thunderbird, etc.) needs to resolve where the image file exists so that it can access it from that location and display it. Otherwise the recipient gets an empty/blank box where the image should be displayed.

If the image file is an Attached or Embedded document with the email, then it can access it locally. If the file is not Attached or Embedded, it must be 'accessible' across the web and specifically defined so that it can be accessed from that location.

You might want to do a Google search for: image in email or image in HTML email

Good Luck,
JRB-Bldr




 
Champs, both of you. Star and Star !!


Thanks guys. :)


FOXUP!
 
Agreed. But one possible problem: some spam filters might be suspicious of external links within messages where the target isn't visible to the user. I'm not sure how much of an issue that would be, but it's worth keeping in mind.

And, depending on user settings, some emails won't be seen by their recipient if the only content is HTML. Some people read mail in plain text only to avoid possible virus infections, or have their mail client set not to display embedded images by default.

This wheel has been invented. Examine your own inbox (and junk mail folder) to see how the folks with experience do this!
 
Hi All,

I am receiving a "450 the server rejected one or more recipient addresses. The server response was 450 too many connections from your ip (rate controlled)". Flippin server, I only have 375 recipients. Any work around??

It would be most appreciated.


Thanks,
John Kappos
 
The first place I would start would be to better understand the REAL source of the problem.

the server rejected one or more recipient addresses. The server response was 450 too many connections from your ip[/i]
Those appear to be 2 VERY different types of problems.

When I do a Google Search for: Server Response 450

The info I am finding on that seems to focus more on Invalid Email Address than it does on anything else.

"Too many connections" seems to be a Server Response 421 (Google for: server response "too many connections")

With the 450 in mind, I would first check on the validity of all of the Recipient Email Addresses to ensure 100% of them are validly formatted. Maybe create a routine to validate/correct all email addresses prior to sending - and avoid sending to any address that cannot be 'corrected' if needed.

Next, assuming that was all the email addresses were confirmed to be OK, I would check to see if this error was being introduced AFTER the addition of the Logo to your HTML documents and that it would go away if you REMOVED that.
If so, then perhaps it has to do with referencing a Logo Image File too many times on the server - just a totally WILD GUESS.

Good Luck,
JRB-Bldr
 
Hi All,

I found out that our flippin server was the problem. It's our Barracuda Spam Firewall that was the root cause of this 'rate control' problem. I added an exception email address in the "Rate Control" settings and it works like a charm. Thank you so much to everybody.


Thanks,
FOXUP!

 
It's also worth stopping to think for a moment.

If someone has decided that you should be protected from exactly what you're doing, then should you really be doing it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top